Submission #383247

#TimeUsernameProblemLanguageResultExecution timeMemory
383247Ahmad_HasanCONSUL (info1cup19_consul)C++17
100 / 100
38 ms380 KiB
#include<bits/stdc++.h> #include "grader.h" /** |||||||||| ||||| ||||| |||||||||| ||||||||||||| ||||| ||||| ||||| |||| |||||| ||||| ||||| ||||| ||||||||||||||||| ||||||||||||||| |||||||||| ||||||||||||||||||| ||||||||||||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| ||||| |||||||||| AHMED;HASSAN;SAEED; */ using namespace std; static const int MIN_VALUE = 0, MAX_VALUE = (1e9) - 1; static map<int,int> mp; static int Q, N, a[5005]; static bool issol, answer; void solve(int n){ vector<int>vis(n); for(int i=0;i<min(30,n/2);i++){ int ri=rand()%n; while(vis[ri]){ ri=rand()%n; } vis[ri]=1; int ret=kth(ri+1); int ret2=cnt(ret); if(ret2>((n)/3)){ say_answer(ret); return; } } say_answer(-1); }

Compilation message (stderr)

consul.cpp:20:20: warning: 'answer' defined but not used [-Wunused-variable]
   20 | static bool issol, answer;
      |                    ^~~~~~
consul.cpp:20:13: warning: 'issol' defined but not used [-Wunused-variable]
   20 | static bool issol, answer;
      |             ^~~~~
consul.cpp:19:18: warning: 'a' defined but not used [-Wunused-variable]
   19 | static int Q, N, a[5005];
      |                  ^
consul.cpp:19:15: warning: 'N' defined but not used [-Wunused-variable]
   19 | static int Q, N, a[5005];
      |               ^
consul.cpp:19:12: warning: 'Q' defined but not used [-Wunused-variable]
   19 | static int Q, N, a[5005];
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...