Submission #743260

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
7432602023-05-17 09:16:47NintsiChkhaidzeJob Scheduling (CEOI12_jobs)C++17
100 / 100
495 ms26144 KiB
#include <bits/stdc++.h>
#define ll long long
#define s second
#define pb push_back
#define f first
using namespace std;
const int N = 1e5 + 5;
pair <int,int> a[1000005];
vector <int> v[N],ans[N];
int n,m,d;
bool check(int x){
int l = 1;
for (int i = 1; i <= n; i++){
v[i].clear();
while (l <= m && a[l].f <= i && i - a[l].f <= d && v[i].size() < x){
v[i].pb(a[l].s);
++l;
}
}
if (l != m + 1) return 0;
for (int i = 1; i <= n; i++){
ans[i] = v[i];
}
return 1;
}
signed main (){
ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

jobs.cpp: In function 'bool check(int)':
jobs.cpp:17:66: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   17 |   while (l <= m && a[l].f <= i && i - a[l].f <= d && v[i].size() < x){
      |                                                      ~~~~~~~~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...