Submission #423175

#TimeUsernameProblemLanguageResultExecution timeMemory
423175xyzCounting Mushrooms (IOI20_mushrooms)C++17
0 / 100
3 ms200 KiB
#include <bits/stdc++.h> #include "mushrooms.h" using namespace std; typedef long long ll; int count_mushrooms(int n){ vector<int> A, B; int m = min(n, 200); A = {0}; for(int i = 1; i < m; i ++){ vector<int> ask = {0, i}; int x = use_machine(ask); if(!x) A.push_back(i); else B.push_back(i); } int result = A.size(); for(int i = m; i < n; i += m){ vector<int> ask = {0}; int cur = 1; for(int j = i; j < min(n, i + m); j ++){ ask.push_back(j); ask.push_back(A[cur ++]); } int x = use_machine(ask), y = ask.size(); result += ((y - 1) - x) / 2; } return result; }
#Verdict Execution timeMemoryGrader output
Fetching results...