제출 #423708

#제출 시각아이디문제언어결과실행 시간메모리
423708Mohammed_Atalah버섯 세기 (IOI20_mushrooms)C++17
25 / 100
139 ms552 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; int count_mushrooms(int n) { vector<int> indices; for (int i = 0; i < n; i++) { indices.push_back(i); } if (use_machine(indices) == 0) { return n; } int bs = 0; for (int i = 1; i < n; i += 2) { if (i + 1 == n) { std::vector<int> v; v.push_back(0); v.push_back(i); if (use_machine(v) == 1) { bs++; } continue; } std::vector<int> v; v.push_back(i); v.push_back(0); v.push_back(i + 1); bs += use_machine(v); } return n - bs; }
#Verdict Execution timeMemoryGrader output
Fetching results...