# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
946169 | 2024-03-14T11:39:03 Z | Nika533 | 팀들 (IOI15_teams) | C++14 | 4000 ms | 84536 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<int> 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]); vb[b[i]].pb(b[i]); } } int can(int M, int K[]) { vector<int> vk[n+5]; for (int i=0; i<M; i++) vk[K[i]].pb(i); multiset<int> myset; for (int i=1; i<=n; i++) { for (auto x:va[i]) { myset.insert(x); } for (auto x:vk[i]) { if (myset.size()<i) return 0; int j=i; while (j--) myset.erase(myset.begin()); } for (auto x:vb[i]) { myset.erase(myset.find(x)); } } return 1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 9 ms | 27228 KB | Output is correct |
2 | Correct | 6 ms | 27228 KB | Output is correct |
3 | Correct | 6 ms | 27228 KB | Output is correct |
4 | Correct | 6 ms | 27072 KB | Output is correct |
5 | Incorrect | 6 ms | 27228 KB | Output isn't correct |
6 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 19 ms | 33584 KB | Output is correct |
2 | Correct | 20 ms | 33740 KB | Output is correct |
3 | Incorrect | 36 ms | 37920 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 58 ms | 34296 KB | Output is correct |
2 | Correct | 67 ms | 34504 KB | Output is correct |
3 | Execution timed out | 4019 ms | 38940 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 349 ms | 62580 KB | Output is correct |
2 | Correct | 310 ms | 62524 KB | Output is correct |
3 | Execution timed out | 4093 ms | 84536 KB | Time limit exceeded |
4 | Halted | 0 ms | 0 KB | - |