Submission #24417

#TimeUsernameProblemLanguageResultExecution timeMemory
24417Extazy돌 무게 재기 (IZhO11_stones)C++14
0 / 100
0 ms18408 KiB
#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)

stones.cpp: In function 'int main()':
stones.cpp:30:20: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
                    ^
stones.cpp:46:31: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &x, &y);
                               ^
#Verdict Execution timeMemoryGrader output
Fetching results...