Submission #1079957

# Submission time Handle Problem Language Result Execution time Memory
1079957 2024-08-29T04:56:51 Z Jawad_Akbar_JJ Counting Mushrooms (IOI20_mushrooms) C++17
0 / 100
1 ms 344 KB
#include <iostream>
#include <vector>

#include "mushrooms.h"

using namespace std;

int count_mushrooms(int n){
	int A = 1;
	vector<int> vec;
	for (int i=1;i<n;){
		if (i + 1 < n and n > 4){
			vec = {i, 0, i+1, 0};
			int ans = use_machine(vec);
			if (ans == 0)
				A += 2;
			else if (ans != 3)
				A++;
			i += 2;
		}
		else{
			vec = {i, 0};
			A += use_machine(vec) == 0;
			i++;
		}
	}
	return A;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Incorrect 0 ms 344 KB Duplicate value 0 in the query array.
4 Halted 0 ms 0 KB -