| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1297223 | kawhiet | 버섯 세기 (IOI20_mushrooms) | C++20 | 55 ms | 400 KiB |
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
int count_mushrooms(int n) {
int res = 1, prv = 0;
for (int i = 1; i < n; i++) {
int x = use_machine({i - 1, i});
if (prv == 0 && x == 0) {
res++;
} else if (prv == 1 && x == 1) {
res++;
}
if (x == 1) {
prv ^= 1;
}
}
return res;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
