| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1240122 | franuch | Counting Mushrooms (IOI20_mushrooms) | C++20 | 49 ms | 420 KiB |
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
typedef pair<ll, ll> pll;
#define vc vector
#define st first
#define nd second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)a.size()
#define pub push_back
#define pob pop_back
ll count_mushrooms(ll n) {
vc<ll> a(n, -1);
a[0] = 0;
for (ll i = 1; i < n; i++)
if (use_machine({i - 1, i}) == 0)
a[i] = a[i - 1];
else
a[i] = a[i - 1] ^ 1;
ll ret = 0;
for (ll &ai : a)
if (ai == 0)
ret++;
return ret;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
