제출 #346038

#제출 시각아이디문제언어결과실행 시간메모리
346038tamarito버섯 세기 (IOI20_mushrooms)C++14
0 / 100
17 ms364 KiB
#include "mushrooms.h" int count_mushrooms(int n) { int answer = 0; for (int i = 0; i < n; i += 2) { if (i == n - 1) { if (use_machine({0, i}) == 0) { answer++; } break; } if (use_machine({i, i + 1}) == 1) { answer++; } else { if (use_machine({0, i, i + 1}) == 0) { answer += 2; } } } return answer; }
#Verdict Execution timeMemoryGrader output
Fetching results...