# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
358478 |
2021-01-25T14:35:34 Z |
Kerim |
Teams (IOI15_teams) |
C++17 |
|
2497 ms |
15852 KB |
#include "teams.h"
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x) cerr<< #x <<" = "<< x<<endl;
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
template<class T>bool umin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T>bool umax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
PII arr[MAXN];
int n;
void init(int N, int A[], int B[]) {n=N;
for(int i=0;i<n;i++)arr[i]=mp(B[i],A[i]);
sort(arr,arr+n);
}
int can(int M, int K[]) {
priority_queue<PII>q;
sort(K,K+M);int p=0;
for(int i=0,j;i<M;i++){
while(p<n and arr[p].ff<K[i])p++;
for(j=0;!q.empty() and j<K[i];j++){
PII nd=q.top();q.pop();
if(nd.ss<K[i])j--;
}
for(;p<n and j<K[i];j++){
if(arr[p].ss>K[i]){
j--;q.push(mp(-arr[p].ss,arr[p].ff));
}
p++;
}
if(j!=K[i])
return 0;
}
return 1;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
3816 KB |
Output is correct |
2 |
Correct |
29 ms |
3688 KB |
Output is correct |
3 |
Correct |
17 ms |
3180 KB |
Output is correct |
4 |
Correct |
26 ms |
4328 KB |
Output is correct |
5 |
Correct |
12 ms |
2668 KB |
Output is correct |
6 |
Correct |
12 ms |
2668 KB |
Output is correct |
7 |
Correct |
14 ms |
3812 KB |
Output is correct |
8 |
Correct |
14 ms |
3812 KB |
Output is correct |
9 |
Correct |
8 ms |
2924 KB |
Output is correct |
10 |
Correct |
6 ms |
2532 KB |
Output is correct |
11 |
Correct |
6 ms |
2540 KB |
Output is correct |
12 |
Correct |
7 ms |
2540 KB |
Output is correct |
13 |
Correct |
14 ms |
2924 KB |
Output is correct |
14 |
Correct |
14 ms |
2796 KB |
Output is correct |
15 |
Incorrect |
22 ms |
4196 KB |
Output isn't correct |
16 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2497 ms |
4784 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
41 ms |
15852 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |