Skip to content

Commit

Permalink
change testcase
Browse files Browse the repository at this point in the history
  • Loading branch information
shogo314 committed Nov 10, 2023
1 parent 3f55cfb commit 8ccc0ab
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 27 deletions.
27 changes: 0 additions & 27 deletions test/atcoder-abc126-d.test.cpp

This file was deleted.

22 changes: 22 additions & 0 deletions test/atcoder-code_festival_2017_qualb_c.test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#define PROBLEM "https://atcoder.jp/contests/code-festival-2017-qualb/tasks/code_festival_2017_qualb_c"

Check failure on line 1 in test/atcoder-code_festival_2017_qualb_c.test.cpp

View workflow job for this annotation

GitHub Actions / verify

failed to verify

#include <array>

#include "../cpp/graph_util.hpp"

int main() {
long long N, M;
std::cin >> N >> M;
Graph<int> graph(N);
graph.read(M, -1);
std::vector<int> color = bipartite_coloring(graph);

if (color.empty()) {
std::cout << N * (N - 1) / 2 - M << std::endl;
} else {
std::array<long long, 2> cnt = {0, 0};
cnt[0] = count(color.begin(), color.end(), 0);
cnt[1] = count(color.begin(), color.end(), 1);
std::cout << cnt[0] * cnt[1] - M << std::endl;
}
}

0 comments on commit 8ccc0ab

Please sign in to comment.