Submission #593828

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5938282022-07-11 16:05:49AlperenTThe Big Prize (IOI17_prize)C++17
90.20 / 100
69 ms1124 KiB
#include <bits/stdc++.h>
#include "prize.h"
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int int_rand(int a, int b){
return uniform_int_distribution<int>(a, b)(rng);
}
const int TRYMAX = 500, K = 1200;
int maxcnt = 0;
map<int, vector<int>> mp;
vector<int> query(int pos){
if(mp.find(pos) == mp.end()) mp[pos] = ask(pos);
return mp[pos];
}
int find_best(int n){
set<int> st;
while(st.size() < n && st.size() < TRYMAX) st.insert(int_rand(0, n - 1));
for(auto i : st){
vector<int> vec = query(i);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

prize.cpp: In function 'int find_best(int)':
prize.cpp:27:18: warning: comparison of integer expressions of different signedness: 'std::set<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   27 |  while(st.size() < n && st.size() < TRYMAX) st.insert(int_rand(0, n - 1));
      |        ~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...