Submission #411642

#TimeUsernameProblemLanguageResultExecution timeMemory
411642JUANDI321Counting Mushrooms (IOI20_mushrooms)C++17
0 / 100
1 ms200 KiB
#include "mushrooms.h" #include <iostream> #include <vector> using namespace std; vector<int> x; int count_mushrooms(int n) { long long A = 1, B = 0; for(int i = 1; i<n; i+=4) { /*if(i+3<n) { x.push_back(i); x.push_back(i+1); x.push_back(i+2); x.push_back(i+3); int p = use_machine(x); if(p == 0) { x.push_back(0); int pp = use_machine(x); if(pp == 0)A+=4; } if(p==1) { x.clear(); x.push_back(i+1); x.push_back(0); x.push_back(i+2); int pp = use_machine(x); if(pp == 2)A+=1; if(pp == 1)A+=2; if(pp == 0)A+=3; } if(p==2) { x.push_back(0); int pp = use_machine(x); if(pp == 2)A+=3; } if(p==3)A+=2; } else */ { x.push_back(0); for(int i = 0; i<n; i++) { i++; x.push_back(i); int p = use_machine(x); if(p==0)A++; x.pop_back(); } } x.clear(); } return A; }

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:9:22: warning: unused variable 'B' [-Wunused-variable]
    9 |     long long A = 1, B = 0;
      |                      ^
#Verdict Execution timeMemoryGrader output
Fetching results...