# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
433139 | rubdary | Counting Mushrooms (IOI20_mushrooms) | C++14 | 205 ms | 420 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "mushrooms.h"
#include<iostream>
using namespace std;
char letras[20000];
int count_mushrooms(int n) {
letras[0] = 'A';
for(int i = 0; i < n-1; i++){
int a = use_machine({i, i+1});
if(a == 0){
letras[i+1] = letras[i];
}else{
if(letras[i] == 'A'){
letras[i+1] = 'B';
}else{
letras[i+1] = 'A';
}
}
}
int c = 0;
for(int i = 0; i < n; i++){
if(letras[i] == 'A') c++;
}
return c;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |