제출 #1297496

#제출 시각아이디문제언어결과실행 시간메모리
1297496kawhiet버섯 세기 (IOI20_mushrooms)C++20
10 / 100
62 ms568 KiB
#include <bits/stdc++.h> #include "mushrooms.h" using namespace std; int count_mushrooms(int n) { int res = 1, prv = 0; vector<int> a = {0}; vector<int> x; for (int i = 1; i < n; i++) { x.push_back(i); } while (!x.empty()) { int m = min(x.size(), a.size()); vector<int> b; for (int i = 0; i < m; i++) { b.push_back(a[i]); b.push_back(x.back()); x.pop_back(); } int k = use_machine(b); res += m - (k + 1) / 2; } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...