Submission #430477

#TimeUsernameProblemLanguageResultExecution timeMemory
430477alireza_kavianiCounting Mushrooms (IOI20_mushrooms)C++17
25 / 100
180 ms296 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;

const int SQ = 101;

int count_mushrooms(int n) {
	vector<int> A = {0} , B;
	int cntA = 1 , cntB = 0;
	for (int i = 1 ; i < n ; i += 2){
		vector<int> v = {i , 0};
		if(i + 1 < n)	v.push_back(i + 1);
		int x = use_machine(v); cntA += v.size() - 1 - x;
		/*if(x == 0){
			cntA++;
			A.push_back(i);
		}
		if(x == 1){
			cntB++;
			B.push_back(i);
		}*/
	}
	return cntA;
}

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:9:17: warning: unused variable 'cntB' [-Wunused-variable]
    9 |  int cntA = 1 , cntB = 0;
      |                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...