# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
946202 | 2024-03-14T12:06:24 Z | Nika533 | 팀들 (IOI15_teams) | C++17 | 4000 ms | 71068 KB |
#pragma GCC diagnostic warning "-std=c++11" #include <bits/stdc++.h> #include "teams.h" #define pb push_back #define f first #define s second #define MOD 1000000007 #define flush fflush(stdout) #define all(x) (x).begin(),(x).end() #define allr(x) (x).rbegin(), (x).rend() #define pii pair<int,int> using namespace std; const int N=5e5+5; int n,m,T,k,a[N],b[N]; vector<pii> va[N],vb[N]; void init(int N, int A[], int B[]) { n=N; for (int i=1; i<=n; i++) { a[i]=A[i-1]; b[i]=b[i-1]; va[a[i]].pb({b[i],i}); vb[b[i]].pb({b[i],i}); } } int can(int M, int K[]) { vector<int> vk(n+1,0); for (int i=0; i<M; i++) vk[K[i]]+=K[i]; set<pii> myset; for (int i=1; i<=n; i++) { for (auto x:va[i]) { myset.insert(x); } while (vk[i]--) { if (myset.size()==0) return 0; myset.erase(myset.begin()); } for (auto x:vb[i]) { myset.erase(x); } } return 1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 8 ms | 27224 KB | Output is correct |
2 | Correct | 5 ms | 27228 KB | Output is correct |
3 | Correct | 7 ms | 27228 KB | Output is correct |
4 | Correct | 6 ms | 27228 KB | Output is correct |
5 | Incorrect | 6 ms | 27228 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 18 ms | 31172 KB | Output is correct |
2 | Correct | 19 ms | 31104 KB | Output is correct |
3 | Incorrect | 47 ms | 35528 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 21 ms | 31436 KB | Output is correct |
2 | Correct | 22 ms | 31952 KB | Output is correct |
3 | Execution timed out | 4069 ms | 35916 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 139 ms | 49336 KB | Output is correct |
2 | Correct | 111 ms | 50032 KB | Output is correct |
3 | Execution timed out | 4056 ms | 71068 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |