Submission #364134

# Submission time Handle Problem Language Result Execution time Memory
364134 2021-02-08T09:35:15 Z yasseenkamel CONSUL (info1cup19_consul) C++14
0 / 100
92 ms 492 KB
#include <bits/stdc++.h>
#include "grader.h"
//#include "grader.cpp"

using namespace std;

map<int,int> vis;

void solve(int n){
    int a[1005];
    for(int i = 0 ; i <= n / 3 ; i ++){
        int x = kth(i + 1);
        if(!vis[x]){
            vis[x] = cnt(x);
        }
        if(vis[x] > n / 3){
            say_answer(x);
            return;
        }
    }
    //sort(a,a + n);
    //int cnt = 1;
    say_answer(-1);
}

Compilation message

consul.cpp: In function 'void solve(int)':
consul.cpp:10:9: warning: unused variable 'a' [-Wunused-variable]
   10 |     int a[1005];
      |         ^
# Verdict Execution time Memory Grader output
1 Incorrect 9 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Correct 16 ms 492 KB Output is correct
2 Incorrect 1 ms 364 KB Wrong answer
# Verdict Execution time Memory Grader output
1 Partially correct 92 ms 364 KB Output is partially correct
2 Halted 0 ms 0 KB -