제출 #1315254

#제출 시각아이디문제언어결과실행 시간메모리
1315254jfioashfn333CONSUL (info1cup19_consul)C++20
100 / 100
10 ms452 KiB
//#include "grader.h" #include <cstdio> #include <iostream> #include <algorithm> #include <vector> #include <math.h> #include <set> //#define int long long #define ff first #define ss second #define pb push_back #define pp pop_back #define all(x) x.begin(),x.end() #define pii pair<int,int> #define r0 return 0 using namespace std; const int N = 5 * 1e5 + 5, M = 55, MOD = 998244353; int x,y,xx,yy,n,m,k,l,ans,tm,check = 0; vector <int> g[N],rd,v; int fix[N],tc[N]; int kth(int i); int cnt(int x); void say_answer(int a); void solve(int N){ n = N; srand(time(0) ^ clock()); for (int i = 1; i <= 30; i++) { int ind = rand() % n + 1; int pick = kth(ind); if (cnt(pick) > n / 3 and check == 0) { say_answer(pick); break; check = 1; } } if (check = 0) say_answer(-1); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...