제출 #588921

#제출 시각아이디문제언어결과실행 시간메모리
588921LIF버섯 세기 (IOI20_mushrooms)C++14
0 / 100
122 ms464 KiB
#include "mushrooms.h" #include<bits/stdc++.h> using namespace std; int count_mushrooms(int n) { std::vector <int> m; int aans = 1; int pointer = 1; bool check[200005]; for(int i=0;i<n;i++) { check[i] = false; } check[0] = true; while(pointer+1<n) { m.push_back(pointer); m.push_back(0); m.push_back(pointer+1); int ans = use_machine(m); aans += (2-ans); m.clear(); check[pointer] = true; check[pointer+1] = true; pointer += 2; } m.push_back(0); for(int i=pointer-2;i<n;i++) { if(check[i] == false) { m.push_back(i); if(use_machine(m) == 0) { aans++; } m.pop_back(); } } return aans; }
#Verdict Execution timeMemoryGrader output
Fetching results...