제출 #661458

#제출 시각아이디문제언어결과실행 시간메모리
661458evenvalue버섯 세기 (IOI20_mushrooms)C++17
25 / 100
111 ms208 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) { int ans = 1 + (n % 2 == 0 ? 1 - use_machine({0, n - 1}) : 0); for (int i = 2; i < n; i += 2) { ans += 2 - use_machine({i - 1, 0, i}); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...