# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1214370 | thangdz2k7 | Counting Mushrooms (IOI20_mushrooms) | C++20 | 0 ms | 0 KiB |
#include "mushrooms.h"
#include "bits/stdc++.h>
using namespace std;
mt19937 rd(chrono::steady_clock::now().time_since_epoch().count());
int count_mushrooms(int n){
if (n <= 227){
int cntA = 1;
for (int i = 1; i < n; ++ i){
vector <int> ask = {0, i};
if (use_machine(ask) == 0) cntA ++;
}
return cntA;
}
return 1;
}