Task: | Data Packet Routing |
Sender: | KnowYourArchitecture |
Submission time: | 2018-05-26 12:11:14 +0300 |
Language: | C++ |
Status: | READY |
Result: | TIME LIMIT EXCEEDED |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.02 s | details |
#2 | ACCEPTED | 0.95 s | details |
#3 | TIME LIMIT EXCEEDED | -- | details |
#4 | TIME LIMIT EXCEEDED | -- | details |
#5 | ACCEPTED | 0.12 s | details |
#6 | ACCEPTED | 0.04 s | details |
#7 | ACCEPTED | 0.01 s | details |
#8 | ACCEPTED | 0.02 s | details |
#9 | ACCEPTED | 0.01 s | details |
Code
#include <bits/stdc++.h> using namespace std; void test() { int n, m; cin >> n >> m; int res = 1; set<pair<int, int>> s; for (int i = 0; i < m; i++) { int x, y; cin >> x >> y; pair<int, int> p{x, y}; if (s.count(p)) { res = 2; } s.insert(p); } cout << res << "\n"; } int main() { int t; cin >> t; while(t--) test(); }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
2 10 3 1 2 2 1 3 4 ... |
correct output |
---|
1 2 |
user output |
---|
1 2 |
Test 2
Verdict: ACCEPTED
input |
---|
10 400 100000 292 392 33 131 61 254 ... |
correct output |
---|
2 2 2 2 2 ... |
user output |
---|
2 2 2 2 2 ... |
Test 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
10 700 100000 603 318 570 280 374 589 ... |
correct output |
---|
2 2 2 2 2 ... |
user output |
---|
(empty) |
Test 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
10 1000 100000 612 150 630 797 925 44 ... |
correct output |
---|
2 2 2 2 2 ... |
user output |
---|
(empty) |
Test 5
Verdict: ACCEPTED
input |
---|
10 1000 10000 25 713 450 653 659 325 ... |
correct output |
---|
2 2 2 2 2 ... |
user output |
---|
2 2 2 2 2 ... |
Test 6
Verdict: ACCEPTED
input |
---|
10 1000 3000 804 754 634 483 331 476 ... |
correct output |
---|
2 2 2 2 2 ... |
user output |
---|
2 2 2 2 2 ... |
Test 7
Verdict: ACCEPTED
input |
---|
10 1000 1000 529 538 501 784 783 645 ... |
correct output |
---|
2 2 2 2 2 ... |
user output |
---|
2 2 2 2 2 ... |
Test 8
Verdict: ACCEPTED
input |
---|
10 1000 300 602 710 622 952 254 471 ... |
correct output |
---|
1 2 2 1 1 ... |
user output |
---|
1 2 2 1 1 ... |
Test 9
Verdict: ACCEPTED
input |
---|
10 1000 100 295 836 509 67 436 838 ... |
correct output |
---|
1 1 1 1 1 ... |
user output |
---|
1 1 1 1 1 ... |