# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
87034 | mirbek01 | Weighting stones (IZhO11_stones) | C++17 | 1076 ms | 1328 KiB |
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 q;
set <int> s1, s2;
int main(){
scanf("%d", &q);
while(q --){
int val, type;
cin >> val >> type;
if(type == 1){
s1.insert(val);
} else {
s2.insert(val);
}
vector <int> v1, v2;
for(auto i : s1)
v1.push_back(i);
for(auto i : s2)
v2.push_back(i);
int pos = 0;
bool ok = 1;
for(int i = 0; i < v1.size(); i ++){
while(pos < v2.size() && v2[pos] < v1[i])
pos ++;
if(pos >= v2.size()){
ok = 0;
break;
}
pos ++;
}
if(ok){
puts("<");
continue;
}
pos = 0;
ok = 1;
for(int i = 0; i < v2.size(); i ++){
while(pos < v1.size() && v1[pos] < v2[i])
pos ++;
if(pos >= v1.size()){
ok = 0;
break;
}
pos ++;
}
if(ok || v1.empty()){
puts(">");
} else {
puts("?");
}
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |