Submission #433139

#TimeUsernameProblemLanguageResultExecution timeMemory
433139rubdaryCounting Mushrooms (IOI20_mushrooms)C++14
10 / 100
205 ms420 KiB
#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 timeMemoryGrader output
Fetching results...