# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
165955 | reda | Job Scheduling (CEOI12_jobs) | C++14 | 640 ms | 16888 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define endl '\n'
int n , m , d;
const int MAXN = 1e5 +7 ;
vector<int> adj[MAXN];
bool bs(int mid , bool h )
{
queue<pii> q;
for(int i = 1 ;i <=n;i++){
for(auto j : adj[i])
q.push({i,j});
for(int j = 0 ;j <mid && q.size() ;j++)
{
if(i-q.front().fi >d)return 0;
if(h)cout<<q.front().se<<' ';
q.pop();
}
if(h) cout<<'0'<<endl;
}
return 1 ;
}
int main ()
{
cin >> n >> d >> m;
for(int i = 1 ;i <= m ;i++)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |