# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
930093 | ByeWorld | Job Scheduling (CEOI12_jobs) | C++14 | 2983 ms | 65536 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define int long long
#define lf (id<<1)
#define rg ((id<<1)|1)
#define md ((l+r)>>1)
using namespace std;
typedef pair<int,int> pii;
typedef pair<pii,int> ipii;
const int INF = 1e18+10;
const int MAXN = 2e5+10;
int a[MAXN];
vector <pii> vec;
vector <vector<int>> ans;
int n, m, k;
signed main() {
cin >> k >> m >> n;
for(int i=1; i<=n; i++){
cin >> a[i]; vec.pb({a[i], i});
}
sort(vec.begin(), vec.end());
int mn = -1, cnt = 1;
for(int i=0; i<n; i+=m){
vector <int> te;
for(int j=0; j<m && i+j<n; j++){
mn = max(mn, cnt-vec[i+j].fi+1);
te.pb(vec[i+j].se);
}
ans.pb(te);
cnt++;
}
cout << mn << '\n';
for(auto vec : ans){
for(auto in : vec){
cout << in << ' ';
}
cout << "0\n";
}
for(int i=0; i<k-ans.size(); i++) cout << "0\n";
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |