# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
798800 | 2023-07-31T04:30:03 Z | tlnk07 | Cijanobakterije (COCI21_cijanobakterije) | C++17 | 38 ms | 1616 KB |
#include<bits/stdc++.h> using namespace std; long long n, chk = 0, m, cnt = 0, x, y, cnt1 = 0, cnt2 = 0; bool check[100001]; int main() { cin >> n >> m; if(n == 1) { cout << 1; return 0; } for(int i = 1; i <= n; ++i) { cin >> x >> y; if(x > 2) chk = 1; if(!check[x]) ++cnt; if(!check[y]) ++cnt; if(x == 1 && !check[y] && y != 2) ++cnt1; else if(x == 2 && !check[y] && y != 1) ++cnt2; check[x] = check[y] = true; } if(!chk) { if(cnt1 > 1 && cnt2 > 1) cout << 6; else if(cnt1 > 1 && cnt2 == 1 || cnt2 > 1 && cnt1 == 1) cout << 5; else if(cnt1 == 0) { if(cnt2 > 1) cout << 4; else if(cnt2 == 1) cout << 3; else cout << 2; } else if(cnt2 == 0) { if(cnt1 > 1) cout << 4; else if(cnt2 == 1) cout << 3; else cout << 2; } } else cout << n; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 660 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 38 ms | 1616 KB | Output is correct |
2 | Correct | 4 ms | 340 KB | Output is correct |
3 | Correct | 7 ms | 468 KB | Output is correct |
4 | Correct | 10 ms | 596 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 304 KB | Output is correct |
2 | Correct | 1 ms | 212 KB | Output is correct |
3 | Incorrect | 1 ms | 212 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 288 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 7 ms | 660 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |