結果
問題 | No.2418 情報通だよ!Nafmoくん |
ユーザー |
|
提出日時 | 2023-09-10 19:43:31 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 70 ms / 2,000 ms |
コード長 | 296 bytes |
コンパイル時間 | 1,323 ms |
コンパイル使用メモリ | 103,316 KB |
実行使用メモリ | 14,784 KB |
最終ジャッジ日時 | 2024-11-14 12:25:39 |
合計ジャッジ時間 | 3,053 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <iostream>#include <atcoder/dsu>using namespace std;int main() {int n, m;cin >> n >> m;atcoder::dsu uf(2 * n);while (m--) {int u, v;cin >> u >> v;u--; v--;uf.merge(u, v);}int ans = 0;for (auto i: uf.groups()) ans += i.size() % 2;cout << ans / 2 << '\n';}