Submission #418134

# Submission time Handle Problem Language Result Execution time Memory
418134 2021-06-05T06:51:42 Z freshmintt Job Scheduling (CEOI12_jobs) C++11
0 / 100
1 ms 460 KB
#include<bits/stdc++.h>
#define MAXN 10 //change
using namespace std;
typedef pair<long long,long long> pi;
typedef long long ll;
typedef long double ld;
ll N, D, M;

#define FIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
ll jobs[MAXN];
ll days[MAXN];

bool works(ll machs) {
  fill(days, days+MAXN, 0);
  for (int i=0; i < N; i++) {
    ll machID = i % machs;
    days[machID]++;
    if ((days[machID] - jobs[i]) > D) return false;
  }
  return true;
}

int main() { 
  // freopen("in", "r", stdin); // comment out
  FIO;
  cin >> N >> D >> M;

  
  for (int i = 0; i < N; i ++) cin >> jobs[i];

  ll a = 1; ll b = 1E9; ll mid;
  while (a != b) {
    mid = (a+b)/2;
    if (works(mid)) {
      b = mid;
    }
    else {
      a = mid + 1;
    }
  }

  cout << mid;



}   
# Verdict Execution time Memory Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 11
2 Runtime error 1 ms 332 KB Execution killed with signal 11
3 Runtime error 1 ms 332 KB Execution killed with signal 11
4 Runtime error 1 ms 332 KB Execution killed with signal 11
5 Runtime error 1 ms 460 KB Execution killed with signal 11
6 Runtime error 1 ms 460 KB Execution killed with signal 11
7 Runtime error 1 ms 332 KB Execution killed with signal 11
8 Runtime error 1 ms 332 KB Execution killed with signal 11
9 Incorrect 0 ms 204 KB Output isn't correct
10 Incorrect 0 ms 204 KB Output isn't correct
11 Runtime error 1 ms 460 KB Execution killed with signal 11
12 Runtime error 1 ms 332 KB Execution killed with signal 11
13 Runtime error 1 ms 332 KB Execution killed with signal 11
14 Runtime error 1 ms 332 KB Execution killed with signal 11
15 Runtime error 1 ms 332 KB Execution killed with signal 11
16 Runtime error 1 ms 460 KB Execution killed with signal 11
17 Runtime error 1 ms 332 KB Execution killed with signal 11
18 Runtime error 1 ms 332 KB Execution killed with signal 11
19 Runtime error 1 ms 332 KB Execution killed with signal 11
20 Runtime error 1 ms 332 KB Execution killed with signal 11