Submission #696826

#TimeUsernameProblemLanguageResultExecution timeMemory
696826esomerCounting Mushrooms (IOI20_mushrooms)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #include "mushrooms.h" using namespace std; #define endl "\n" typedef long long int ll; const int MOD = 1e9 + 7; int use_machine(vector<int> x); int count_mushrooms(int n){ //Initially ask 73 questions. vector<int> a = {0}; vector<int> b; int ans = 1; int rep = use_machine({0, 1}); if(rep == 1){ b.push_back(1); }else {a.push_back(1); ans++;} if(n == 2) return ans; rep = use_machine({0, 2}); if(rep == 1){ b.push_back(2); }else {a.push_back(2); ans++;} int left = 72; int curr = 3; while(left > 0 && curr < n){ if(curr == n - 1){ rep = use_machine({0, curr}); if(rep == 0) ans++; return ans; } if((int)a.size() >= 2){ rep = use_machine({0, curr, a[1], curr + 1}); if(rep >= 2) b.push_back(curr); else {a.push_back(curr); ans++;} if(rep % 2 == 1) b.push_back(curr + 1); else {a.push_back(curr + 1); ans++;} } curr += 2; left--; } while(curr < n){ if((int)a.size() < (int)b.size()){ vector<int> v; for(int x : b){ v.push_back(x); v.push_back(curr); curr++; if(curr == n) break; } rep = use_machine(v); ans += rep / 2; if(rep % 2 == 1) ans++; }else{ vector<int> v; int asked = 0; for(int x : a){ v.push_back(x); v.push_back(curr); curr++; asked++; if(curr == n) break; } rep = use_machine(v); ans += asked - rep / 2; if(rep % 2 == 1) ans--; } } return ans; } int main(){ }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccWJvSyG.o: in function `main':
stub.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cce0TOdH.o:mushrooms.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status