# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
166212 | Dovran | Weighting stones (IZhO11_stones) | C++11 | 1067 ms | 880 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>
#define N 100009
#define pii pair <int, int>
#define ff first
#define ss second
#define pb push_back
#define ll long long
using namespace std;
int n, v[N], c[N];
vector<int>a, b;
int r, l;
int main(){
cin>>n;
for(int i=1; i<=n; i++){
int x, y;
cin>>x>>y;
if(y==1){
a.pb(x), l=max(l, x);
for(int j=x; j>=1; j--)
c[j]--;
}
else{
b.pb(x), r=max(r, x);
for(int j=x; j>=1; j--)
c[j]++;
}
int mn=1e9, mx=0;
for(int j=n; j>=1; j--){
mn=min(mn, c[j]);
mx=max(mx, c[j]);
}
if(l>r and mx<=0)
cout<<">\n";
else if(r>l and mn>=0)
cout<<"<\n";
else
cout<<"?\n";
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |