# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
387540 | ahmet | Job Scheduling (CEOI12_jobs) | C++14 | 303 ms | 23676 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.
//https://oj.uz/problem/view/CEOI12_jobs
//https://usaco.guide/silver/binary-search?lang=cpp
#include <bits/stdc++.h>
using namespace std;
#define zaman cout<<endl<<fixed<<setprecision(2)<<1000.0 * clock() / CLOCKS_PER_SEC<< " milliseconds "
#define rep(i,n) for(long long (i)=0;(i)<(n);++(i))
#define ref(i,a,b) for (long long (i)=(a); (i)<=(b); ++(i))
#define endl '\n'
#define ll long long
#define pb push_back
#define pii pair<ll,ll>
#define mp make_pair
const int mx=2e5+6;
int main(){
ios_base::sync_with_stdio(0);cin.tie(0);
int n,d,m;cin >> n >> d >> m;
vector <pair <int,int> > a(m);
rep(i,m){
int x;cin >> x;
a[i]=mp(x,i);
}
sort(a.begin(),a.end());
int l=1,r=1000000;
while(l<r){
int mid=(l+r)/2;
int res=mid;bool ans=true;
int day=1;
for(int i=0;i<m;++i){
int req=a[i].first;
//if(mid==500000)cout <<i<< " "<<day<< " " <<res<<" "<<req<<endl;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |