# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
780893 | Andrey | CONSUL (info1cup19_consul) | C++14 | 25 ms | 296 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 "grader.h"
#include<bits/stdc++.h>
using namespace std;
void solve(int n)
{
srand(time(NULL));
vector<int> bruh(0);
for(int i = 0; i < n; i++) {
bruh.push_back(i+1);
}
int q,a,br,b;
if(n <= 50) {
q = 25;
}
else {
q = 30;
}
for(int i = 0; i < min(n,q); i++) {
a = rand()%(n-i);
b = kth(bruh[a]);
br = cnt(b);
if(br > n/3) {
say_answer(b);
return;
}
else {
for(int j = a; j < bruh.size()-1; j++) {
swap(bruh[j],bruh[j+1]);
}
bruh.pop_back();
}
}
say_answer(-1);
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |