# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
346208 | SecretK | 버섯 세기 (IOI20_mushrooms) | C++14 | 1 ms | 364 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "mushrooms.h"
int count_mushrooms(int n) {
std::vector<int> m;
int a = 0,t;
int ans = 1;
for (int i = 1; i < n-1; i+=3){
m = {i-1};
for(int j = i;j < i+2;j++){
m.push_back(j);
}
t = use_machine(m);
if(t == 0){
if(!a) ans += 3;
}
if(t == 2){
if(a){
ans++;
a = (a+1)%2;
}
else {
ans += 2;
a = (a+1)%2;
}
}
if(t == 1){
t = use_machine({i-1,i});
if(t && a) ans++;
if(t && !a) ans += 2;
if(!t && a) ans++;
if(!t && !a) ans += 2;
a = (a+1)%2;
}
}
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |