# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
287649 | b00n0rp | 팀들 (IOI15_teams) | C++17 | 4073 ms | 8952 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "teams.h"
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define F first
#define S second
const int MAXN = 500005;
const int LIM = 10000;
int n;
pii a[MAXN];
int dp[MAXN];
void init(int N, int A[], int B[]){
n = N;
for(int i = 0; i < n; i ++){
a[i] = {A[i],B[i]};
}
sort(a,a+n);
}
int query(int l,int r,int val){
int res = 0;
for(int i = l; i <= r; i++){
if(a[i].S >= val) res++;
}
return res;
}
int can(int M, int K[]) {
sort(K,K+M);
if(M > LIM){
return 0;
}
else{
dp[0] = 0;
for(int i = 1; i <= M; i ++){
dp[i] = n+1;
for(int j = 0; j < i; j ++){
// dp[j] + (No. of kids (A, B) satisfying K[j-1] < A <= K[i-1] and B >= K[i-1]))-K[i-1]
int ind1 = (j?(lower_bound(a,a+n,make_pair(K[j-1]+1,-1))-a):0);
int ind2 = (lower_bound(a,a+n,make_pair(K[i-1]+1,-1))-a)-1;
dp[i] = min(dp[i],dp[j]-K[i-1]+query(ind1,ind2,K[i-1]));
}
if(dp[i] < 0) return 0;
// cout << i << " " << dp[i] << endl;
}
return 1;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |