# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
673592 | smartmonky | Weighting stones (IZhO11_stones) | C++14 | 0 ms | 212 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 ff first
#define ss second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
//#define int long long
using namespace std;
void fp(string name){freopen((name+".in").c_str(),"r",stdin); freopen((name+".out").c_str(),"w",stdout);}
const int N = 501 * 500;
int cnt[3], mx[3],kol[3];
int chotam[N];
main(){
//fp("stones");
int q;
cin >> q;
while(q--){
int r, s;
cin >> r >> s;
kol[s]++;
mx[s] = max(mx[s], r);
for(int i = r - 1; i >= 0; i--){
if(chotam[i] != 0 && chotam[i] != s)
cnt[s]++;
}
for(int i = r + 1; i <= 100; i++){
if(chotam[i] != 0 && chotam[i] != 1 - s)
cnt[1 - s]++;
}
chotam[r] = s;
if((cnt[1] == cnt[2] && kol[1] == kol[2]) || (kol[1] > kol[2] && cnt[2] > cnt[1]) || (kol[1] < kol[2] && cnt[2] < cnt[1])){
cout <<"?" << endl;
continue;
}
if(cnt[1] > cnt[2] || kol[1] > kol[2]){
cout <<">" << endl;
continue;
}
cout << "<";
cout << endl;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |