This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
unordered_map<int, int> map1, map2;
int circles, a, b, c;
cin>>circles;
for (int i = 1; i <= circles; ++i) {
cin>>a>>b>>c;
if (map1[a] == map2[b] && map1[a] != 0) {
cout<<map1[a]<<' ';
} else {
map1[a] = i;
map2[b] = i;
cout<<i<<' ';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |