제출 #1185726

#제출 시각아이디문제언어결과실행 시간메모리
1185726islam_2010버섯 세기 (IOI20_mushrooms)C++20
0 / 100
0 ms420 KiB
#include <bits/stdc++.h> #include "mushrooms.h" using namespace std; int count_mushrooms(int n) { int ans = 1; int i = 1; while (i + 1 < n) { int a = use_machine({0, i, i + 1}); if (a == 0) { ans += 2; } else if (a == 1) { int b = use_machine({0, i}); if (b == 0) { ans += 1; } } else { ans += 0; } i += 2; } if (i < n) { int c = use_machine({0, i}); if (c == 0) { ans += 1; } } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...