提出 #62768293
ソースコード 拡げる
Copy
#include <bits/stdc++.h>using namespace std;#define ull unsigned long long#define ll long long#define pii array<int,2>#define endl "\n"void solve() {int n,m;cin >> n >> m;int ans = 0;set<pii> edge;for (int i = 0; i < m; i++) {int u,v;cin >> u >> v;if (u > v) swap(u,v);if (u == v || edge.count({u,v})) ans++;else edge.insert({u,v});}cout << ans << endl;
#include <bits/stdc++.h> using namespace std; #define ull unsigned long long #define ll long long #define pii array<int,2> #define endl "\n" void solve() { int n,m; cin >> n >> m; int ans = 0; set<pii> edge; for (int i = 0; i < m; i++) { int u,v; cin >> u >> v; if (u > v) swap(u,v); if (u == v || edge.count({u,v})) ans++; else edge.insert({u,v}); } cout << ans << endl; } signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t = 1; for (int i = 0; i < t; i++) { solve(); } return 0; }
提出情報
提出日時 | |
---|---|
問題 | C - Make it Simple |
ユーザ | CirnoNine |
言語 | C++ 23 (gcc 12.2) |
得点 | 300 |
コード長 | 642 Byte |
結果 | AC |
実行時間 | 393 ms |
メモリ | 26912 KB |
ジャッジ結果
セット名 | Sample | All | ||||
---|---|---|---|---|---|---|
得点 / 配点 | 0 / 0 | 300 / 300 | ||||
結果 |
|
|
セット名 | テストケース |
---|---|
Sample | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt |
All | 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_n_small_00.txt, 01_n_small_01.txt, 01_n_small_02.txt, 01_n_small_03.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 03_corner_00.txt, 03_corner_01.txt, 03_corner_02.txt, 03_corner_03.txt |
ケース名 | 結果 | 実行時間 | メモリ |
---|---|---|---|
00_sample_00.txt | AC | 1 ms | 3448 KB |
00_sample_01.txt | AC | 1 ms | 3476 KB |
00_sample_02.txt | AC | 1 ms | 3388 KB |
01_n_small_00.txt | AC | 42 ms | 3472 KB |
01_n_small_01.txt | AC | 34 ms | 3528 KB |
01_n_small_02.txt | AC | 55 ms | 3624 KB |
01_n_small_03.txt | AC | 33 ms | 3600 KB |
02_random_00.txt | AC | 195 ms | 17336 KB |
02_random_01.txt | AC | 199 ms | 17180 KB |
02_random_02.txt | AC | 391 ms | 26884 KB |
02_random_03.txt | AC | 382 ms | 26828 KB |
02_random_04.txt | AC | 311 ms | 23540 KB |
02_random_05.txt | AC | 194 ms | 17340 KB |
02_random_06.txt | AC | 393 ms | 26908 KB |
02_random_07.txt | AC | 390 ms | 26912 KB |
03_corner_00.txt | AC | 179 ms | 15236 KB |
03_corner_01.txt | AC | 275 ms | 15320 KB |
03_corner_02.txt | AC | 44 ms | 3700 KB |
03_corner_03.txt | AC | 43 ms | 3452 KB |