Submission #65286

#TimeUsernameProblemLanguageResultExecution timeMemory
65286mirbek01Teams (IOI15_teams)C++17
0 / 100
4051 ms13304 KiB
#include "teams.h" # include <bits/stdc++.h> using namespace std; int n, mt[100005], used[100005]; pair <int, int> a[100005]; void init(int N, int A[], int B[]) { n = N; for(int i = 0; i < n; i ++) a[i] = {B[i], A[i]}; sort(a, a + n); reverse(a, a + n); } int can(int M, int K[]) { int sum = 0; for(int i = 0; i < M; i ++) sum += K[i]; if(sum > n) return false; sort(K, K + M); reverse(K, K + M); int pos = 0; for(int i = 0; i < M; i ++){ int cn = 0; while(pos < n){ if(a[pos].second <= K[i] && K[i] <= a[i].first) cn ++; pos ++; if(cn == K[i]) break; } if(cn != K[i]) return false; } return true; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...