#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <unordered_map>
#define ll long long int
#define F0R(i,n) for(auto i = 0; i < (n); i++)
#define FOR(i,a,b) for(auto i = (a); i <= (b); i++)
#define ROF(i,a,b) for(auto i = (a); i >= (b); i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vv vector
#define F first
#define S second
#define pb push_back
#define vi vector<int>
using namespace std;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n,d,m; cin >> n >> d >> m;
pii a[m+5]; FOR(i,1,m) cin >> a[i].F;
FOR(i,1,m)a[i].S = i;
sort(a+1,a+m+1);
int dayNumber = 1, jobNumber = 1, machines = 1;
while(jobNumber < m) {
if(dayNumber-a[jobNumber].F > d) {
machines++;
jobNumber = machines*(dayNumber-1)+1;
}
if(jobNumber/machines == dayNumber && jobNumber % machines == 0)++dayNumber;
jobNumber++;
}
if((machines*m) % n != 0) ++machines;
cout << machines << "\n";
jobNumber = 1;
F0R(i,n) {
F0R(j,machines) {
// if(jobNumber > m) {
// cout << "0\n";
// goto nextDay;
// } else {
// cout << a[jobNumber++].S << " ";
// }
cout << "69 ";
}
cout << "0\n";
nextDay:;
}
}
Compilation message
jobs.cpp: In function 'int main()':
jobs.cpp:62:3: warning: label 'nextDay' defined but not used [-Wunused-label]
nextDay:;
^~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1091 ms |
65536 KB |
Time limit exceeded |
2 |
Execution timed out |
1092 ms |
65536 KB |
Time limit exceeded |
3 |
Runtime error |
895 ms |
65536 KB |
Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
4 |
Runtime error |
665 ms |
65536 KB |
Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
5 |
Runtime error |
547 ms |
60280 KB |
Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
6 |
Runtime error |
446 ms |
50680 KB |
Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
7 |
Runtime error |
390 ms |
43512 KB |
Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
8 |
Runtime error |
344 ms |
38308 KB |
Memory limit exceeded (if you are sure your verdict is not MLE, please contact us) |
9 |
Execution timed out |
1088 ms |
65536 KB |
Time limit exceeded |
10 |
Execution timed out |
1085 ms |
65536 KB |
Time limit exceeded |
11 |
Partially correct |
26 ms |
1408 KB |
Partially correct |
12 |
Partially correct |
47 ms |
2552 KB |
Partially correct |
13 |
Partially correct |
69 ms |
3576 KB |
Partially correct |
14 |
Partially correct |
94 ms |
4728 KB |
Partially correct |
15 |
Incorrect |
117 ms |
5752 KB |
Output isn't correct |
16 |
Partially correct |
140 ms |
6904 KB |
Partially correct |
17 |
Partially correct |
167 ms |
7928 KB |
Partially correct |
18 |
Partially correct |
374 ms |
30328 KB |
Partially correct |
19 |
Execution timed out |
1083 ms |
65536 KB |
Time limit exceeded |
20 |
Partially correct |
168 ms |
7928 KB |
Partially correct |