# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
384667 | DarkVoid | Job Scheduling (CEOI12_jobs) | C++11 | 100 / 100 | 404 ms | 24780 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (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... |