Submission #1302036

#TimeUsernameProblemLanguageResultExecution timeMemory
1302036lunarecho버섯 세기 (IOI20_mushrooms)C++20
0 / 100
1 ms332 KiB
#include "mushrooms.h" using namespace std; int count_mushrooms(int n) { int speciesA = 1; for(int i=1;i+1<n;i+=2) { int c = use_machine({0, i, i + 1}); if(c == 0) { speciesA += 2; } else if(c == 1 && use_machine({i, i + 1}) == 1) { ++speciesA; } } if(n % 2 == 0) { int c = use_machine({0, n - 1}); if(c == 0) { ++speciesA; } } return speciesA; }
#Verdict Execution timeMemoryGrader output
Fetching results...