Submission #507537

#TimeUsernameProblemLanguageResultExecution timeMemory
507537Christopher_Job Scheduling (CEOI12_jobs)C++17
0 / 100
938 ms52876 KiB
/** * author: lani * created: 12.01.2022 20:57:54 **/ #include <bits/stdc++.h> using namespace std; #ifdef DEBUG #include "debug.hpp" #else #define dbg(...) void(37) #endif int main() { ios::sync_with_stdio(false); cin.tie(0); int n, d, m; cin >> n >> d >> m; set<pair<int,int>> s; for (int i = 0; i < m; ++i) { int tmp; cin >> tmp; s.insert({tmp, i}); } int mn = 1; int cnt = 1; for (auto [x, y] : s) { int res = cnt / (x + 2); if (cnt % (x + 2)) { ++res; } mn = max(mn, res); } cout << mn << '\n'; cnt = 0; int list = 1; for (auto [x, y] : s) { ++cnt; if (cnt == 3) { cout << 0 << '\n'; ++list; cnt = 1; cout << y + 1 << ' '; } else { cout << y + 1 << ' '; } } if (m % mn) { cout << 0 << '\n'; } for (; list <= n; ++list) { cout << "0\n"; } }
#Verdict Execution timeMemoryGrader output
Fetching results...