| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1031122 | happy_node | Counting Mushrooms (IOI20_mushrooms) | C++17 | 8 ms | 700 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 "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
const int B=400;
int count_mushrooms(int N) {
	vector<int> posA, posB;
	posA.push_back(0);
	for(int i=1;i<min(N,B);i++) {
		if(use_machine({0,i})==0) posA.push_back(i);
		else posB.push_back(i);
	}
	int ans=posA.size();
	if(posA.size()>posB.size()) {
		int s=posA.size();
		for(int i=B;i<N;i+=s) {
			vector<int> qry;
			for(int j=i;j<min(N,i+s);j++) {
				qry.push_back(posA[j-i]);
				qry.push_back(j);
			}	
			int w=use_machine(qry);
			w=(w+1)/2;
			ans+=(qry.size()/2-w);
		}
	} else {
		int s=posB.size();
		for(int i=B;i<N;i+=s) {
			vector<int> qry;
			for(int j=i;j<min(N,i+s);j++) {
				qry.push_back(posB[j-i]);
				qry.push_back(j);
			}	
			int w=use_machine(qry);
			w=(w+1)/2;
			ans+=w;
		}
	}
	return ans;
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
