# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
831898 | 2023-08-20T17:07:10 Z | Darren0724 | Job Scheduling (CEOI12_jobs) | C++17 | 229 ms | 12812 KB |
#include<bits/stdc++.h> using namespace std; #define int long long #define x first #define y second const int mod=1e9+7; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(0); int n,d,m;cin>>n>>d>>m; vector<int> v[n+1]; for(int i=1;i<=m;i++){ int p;cin>>p; v[p].push_back(i); } queue<int> q; int l=0,r=m; while(r-l>1){ int mi=(l+r)>>1; bool flag=0; for(int i=1;i<=n;i++){ for(int j=0;j<v[i].size();j++){ q.push(i); } for(int j=0;j<mi;j++){ if(q.size()==0){ break; } int p=q.front(); flag|=(i>=p+d); q.pop(); } } if(q.size()||flag){ l=mi; } else{ r=mi; } } cout<<r<<endl; for(int i=0;i<n;i++){ cout<<0<<endl; } return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 22 ms | 2216 KB | Output isn't correct |
2 | Incorrect | 22 ms | 2128 KB | Output isn't correct |
3 | Incorrect | 22 ms | 2200 KB | Output isn't correct |
4 | Incorrect | 22 ms | 2220 KB | Output isn't correct |
5 | Incorrect | 22 ms | 2188 KB | Output isn't correct |
6 | Incorrect | 22 ms | 2128 KB | Output isn't correct |
7 | Incorrect | 27 ms | 2200 KB | Output isn't correct |
8 | Incorrect | 25 ms | 2204 KB | Output isn't correct |
9 | Incorrect | 115 ms | 4168 KB | Output isn't correct |
10 | Incorrect | 113 ms | 4240 KB | Output isn't correct |
11 | Incorrect | 14 ms | 1400 KB | Output isn't correct |
12 | Incorrect | 26 ms | 2388 KB | Output isn't correct |
13 | Incorrect | 38 ms | 4668 KB | Output isn't correct |
14 | Incorrect | 74 ms | 7532 KB | Output isn't correct |
15 | Incorrect | 62 ms | 6376 KB | Output isn't correct |
16 | Incorrect | 111 ms | 10052 KB | Output isn't correct |
17 | Incorrect | 122 ms | 12804 KB | Output isn't correct |
18 | Correct | 116 ms | 9384 KB | Output is correct |
19 | Incorrect | 229 ms | 11952 KB | Output isn't correct |
20 | Incorrect | 124 ms | 12812 KB | Output isn't correct |