# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24405 | 2017-06-07T08:24:43 Z | Extazy | Weighting stones (IZhO11_stones) | C++14 | 706 ms | 4664 KB |
#include <bits/stdc++.h> using namespace std; const int N = 1<<17; int n; set < int, greater < int > > s[2]; set < int, greater < int > >::iterator it0,it1; int cnt; int main() { int i,x,y; scanf("%d", &n); for(i=1;i<=n;i++) { scanf("%d %d", &x, &y); s[y-1].insert(x); if(s[0].empty()) printf("<\n"); else if(s[1].empty()) printf(">\n"); else if(*s[0].begin()>*s[1].begin()) { cnt=0; for(it0=s[0].begin(),it1=s[1].begin();it0!=s[0].end() && it1!=s[1].end();it0++,it1++) { if(*it0>*it1) ++cnt; else break; if(cnt>1000) { cnt=s[1].size(); break; } } if(cnt==(int)(s[1].size())) printf(">\n"); else printf("?\n"); } else { cnt=0; for(it0=s[0].begin(),it1=s[1].begin();it0!=s[0].end() && it1!=s[1].end();it0++,it1++) { if(*it0<*it1) ++cnt; else break; if(cnt>1000) { cnt=s[0].size(); break; } } if(cnt==(int)(s[0].size())) printf("<\n"); else printf("?\n"); } } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 2024 KB | Output is correct |
2 | Correct | 0 ms | 2024 KB | Output is correct |
3 | Correct | 0 ms | 2024 KB | Output is correct |
4 | Correct | 0 ms | 2024 KB | Output is correct |
5 | Correct | 0 ms | 2024 KB | Output is correct |
6 | Correct | 0 ms | 2024 KB | Output is correct |
7 | Correct | 0 ms | 2024 KB | Output is correct |
8 | Correct | 0 ms | 2156 KB | Output is correct |
9 | Correct | 0 ms | 2156 KB | Output is correct |
10 | Correct | 23 ms | 2420 KB | Output is correct |
11 | Incorrect | 706 ms | 4664 KB | Output isn't correct |
12 | Halted | 0 ms | 0 KB | - |