Submission #697084

#TimeUsernameProblemLanguageResultExecution timeMemory
697084garam1732Carnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; vector<int> a, b; int cnt = 100; int count_mushrooms(int n) { a.push_back(0); int x, y; bool z; std::vector<int> m; use_machine({0, 1}) ? b.push_back(1) : a.push_back(1); use_machine({0, 2}) ? b.push_back(2) : a.push_back(2); if(a.size() > 1) { for(int i = 4; i <= n && i <= 2*cnt; i += 2) { m = {a[0], i-1, a[1], i}; if(i == n) { m.pop_back(); int res = use_machine(m); res ? b.push_back(i-1) : a.push_back(i-1); } else { int res = use_machine(m); (res < 2) ? a.push_back(i-1) : b.push_back(i-1); (res & 1) ? b.push_back(i) : a.push_back(i); } } } else { for(int i = 4; i <= n && i <= 2*cnt; i += 2) { m = {b[0], i-1, b[1], i}; if(i == n) { m.pop_back(); int res = use_machine(m); res ? a.push_back(i-1) : b.push_back(i-1); } else { int res = use_machine(m); (res < 2) ? b.push_back(i-1) : a.push_back(i-1); (res & 1) ? a.push_back(i) : b.push_back(i); } } } if(a.size() + b.size() == n) return a.size(); int res = a.size(); if(a.size() >= cnt) { int idx = 2*cnt+1; while(idx < n) { m.clear(); m.push_back(a[0]); for(int i = 1; i < a.size(); i++) { if(idx < n) m.push_back(idx++); m.push_back(a[i]); } res += (int)m.size()-(int)a.size()-use_machine(m)/2; } } else { int idx = 2*cnt+1; while(idx < n) { m.clear(); m.push_back(b[0]); for(int i = 1; i < b.size(); i++) { if(idx < n) m.push_back(idx++); m.push_back(b[i]); } res += use_machine(m)/2; } } return res; }

Compilation message (stderr)

tickets.cpp:1:10: fatal error: mushrooms.h: No such file or directory
    1 | #include "mushrooms.h"
      |          ^~~~~~~~~~~~~
compilation terminated.