Submission #1185692

#TimeUsernameProblemLanguageResultExecution timeMemory
1185692islam_2010버섯 세기 (IOI20_mushrooms)C++20
0 / 100
49 ms424 KiB
#include <bits/stdc++.h> #include "mushrooms.h" using namespace std; int count_mushrooms(int n){ int l = 1, r = n-2; int x = use_machine({0, n-1}); int ans = 0; while (l < r){ int a = use_machine({0, l}); int b = use_machine({l, r}); if(a==0){ if(b==0){ ans+=2; }if(b==1){ ans++; } }else { if(b==1){ ans++; } } }if(x==1){ ans++; }else { ans+=2; }return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...