# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
637805 | beaconmc | Job Scheduling (CEOI12_jobs) | C++14 | 1098 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
typedef long long ll;
using namespace std;
using namespace __gnu_pbds;
#define FOR(i, x, y) for(ll i=x; i<y; i++)
#define FORNEG(i, x, y) for(ll i=x; i>y; i--)
#define ordered_set tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL)
ll temp;
ll n,d,m;
ll lis[1000001];
bool check(ll x){
ll cur = 0;
FOR(i,0,n){
cur += lis[i];
cur -= x;
if (cur >= x*d){
return false;
}
}
return true;
}
void sus(ll x){
}
int main(){
cin >> n >> d >> m;
FOR(i,0,n){
cin >> temp;
lis[temp-1] += 1;
}
ll lo = 0;
ll hi = 1000001;
while (lo<hi){
ll mid = (lo+hi+1)/2;
if (check(mid)){
hi = mid;
}else{
lo = mid+1;
}
}
cout << lo;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |