# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
384667 | DarkVoid | Job Scheduling (CEOI12_jobs) | C++11 | 100 / 100 | 404 ms | 24780 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#pragma GCC optimize("unroll-loops, O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)
using namespace std;
int n, q, m;
pair<int, int> a[1000001];
vector<vector<int>> check(int cnt){
vector<vector<int>> res;
int k = 1;
for(int i = 1; i <= n; i++){
res.emplace_back();
for(int j = 0; j < cnt && k <= m && a[k].first <= i; j++, k++)
if(a[k].first + q < i) return {};
else res.back().push_back(a[k].second);
}
if(k <= m) return {};
else return res;
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n >> q >> m;
for(int i = 1; i <= m; i++)
cin >> a[i].first, a[i].second = i;
sort(a, a + m + 1);
int l = 1, r = 1e6;
vector<vector<int>> ans;
while(l < r){
int mid = l + (r - l) / 2;
vector<vector<int>> work = check(mid);
if(!work.empty()) ans = work, r = mid;
else l = mid + 1;
}
cout << r << '\n';
for(auto &i : ans){
for(int j : i) cout << j << ' ';
cout << "0\n";
}
return 0;
}
Compilation message (stderr)
jobs.cpp:1:40: warning: bad option '-f O3' to pragma 'optimize' [-Wpragmas] 1 | #pragma GCC optimize("unroll-loops, O3") | ^ jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] 2 | #pragma GCC target("avx") | ^ jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] jobs.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] /var
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |