Submission #661455

#TimeUsernameProblemLanguageResultExecution timeMemory
661455evenvalueCounting Mushrooms (IOI20_mushrooms)C++17
10 / 100
204 ms460 KiB
#include "mushrooms.h" #include <bits/stdc++.h> using namespace std; template<typename T> using min_heap = priority_queue<T, vector<T>, greater<T>>; template<typename T> using max_heap = priority_queue<T, vector<T>, less<T>>; using int64 = long long; using ld = long double; constexpr int kInf = 1e9 + 10; constexpr int64 kInf64 = 1e15 + 10; constexpr int kMod = 1e9 + 7; int count_mushrooms(int n) { vector<int> val(n); for (int i = 1; i < n; i++) { val[i] = (use_machine({i - 1, i}) == 1 ? 1 - val[i - 1] : val[i - 1]); } return count(val.begin(), val.end(), 0); }
#Verdict Execution timeMemoryGrader output
Fetching results...