제출 #315154

#제출 시각아이디문제언어결과실행 시간메모리
315154daniel920712CONSUL (info1cup19_consul)C++14
16 / 100
3062 ms256 KiB
#include "grader.h" #include "grader.h" #include <map> #include <time.h> #include <algorithm> using namespace std; map < int , int > all; int how[1005]; void solve(int n) { srand(time(NULL)); all.clear(); int i,t,big=0,xx=n,x,y; if(n<=50) { for(i=1;i<=n;i++) { t=kth(i); how[i]=t; if(i>1&&how[i]>how[i-1]) while(1) ; all[t]++; big=max(big,all[t]); if(all[t]>n/3) { say_answer(t); return; } if(big+(n-i)<=n/3) { say_answer(-1); return; } } say_answer(-1); } else { for(i=1;i<=n/3*2+2;i++) { t=kth(i); all[t]++; if(all[t]==2) { x=cnt(t); big=max(big,x); xx-=(x-2); } if(big>n/3) { say_answer(t); return; } } say_answer(-1); } }

컴파일 시 표준 에러 (stderr) 메시지

consul.cpp: In function 'void solve(int)':
consul.cpp:13:26: warning: unused variable 'y' [-Wunused-variable]
   13 |     int i,t,big=0,xx=n,x,y;
      |                          ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...