# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
24417 | Extazy | 돌 무게 재기 (IZhO11_stones) | C++14 | 0 ms | 18408 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;
const int N = 1<<17;
const int G = 32;
struct xorshift {
unsigned x,y,z,w;
xorshift(): x(123456789), y(2387329), z(7777777), w(87389) {}
unsigned next() {
unsigned t=x^(x<<11);
x=y;y=z;z=w;
return w=w^(w>>19)^t^(t>>8);
}
unsigned next(unsigned a) {
return next()%a;
}
unsigned next(int a, int b) {
return a+next(b-a+1);
}
} rng;
int n,w[G][N];
long long s[2][G];
int main() {
int i,j,x,y,cnt0,cnt1;
scanf("%d", &n);
for(i=1;i<=30;i++) {
map < int, bool > have;
for(j=1;j<=n;j++) {
w[i][j]=rng.next(1,1000000000);
if(have.find(w[i][j])==have.end()) have[w[i][j]]=true;
else {
--j;
continue;
}
}
sort(w[i]+1,w[i]+1+n);
}
for(i=1;i<=n;i++) {
scanf("%d %d", &x, &y);
--y;
for(j=1;j<=30;j++) s[y][j]+=w[j][x];
cnt0=cnt1=0;
for(j=1;j<=30;j++) cnt0+=(s[0][j]>s[1][j]),cnt1+=(s[1][j]>s[0][j]);
if(cnt0==30) printf(">\n");
else if(cnt1==30) printf("<\n");
else printf("?\n");
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |