# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1220829 | brinton | 버섯 세기 (IOI20_mushrooms) | C++20 | 51 ms | 628 KiB |
#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;
int count_mushrooms(int n) {
vector<int> value{1};
for (int i = 0; i+1 < n; i++){
int type = use_machine({i,i+1});
if(type == 0){
// same;
value.push_back(value.back());
}else{
value.push_back(1-value.back());
}
}
int ans = accumulate(value.begin(),value.end(),0);
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |