이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "teams.h"
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
#define all(v) v.begin(),v.end()
#pragma gcc optimize("O3")
#pragma gcc optimize("Ofast")
#pragma gcc optimize("unroll-loops")
using namespace std;
const int INF = 1e9;
const int TMX = 1 << 18;
const long long llINF = 1e18;
const long long mod = 1e9+7;
const long long hashmod = 100003;
const int MAXN = 100000;
const int MAXM = 1000000;
typedef long long ll;
typedef long double ld;
typedef pair <int,int> pi;
typedef pair <ll,ll> pl;
typedef vector <int> vec;
typedef vector <pi> vecpi;
typedef long long ll;
int n;
pi a[500005];
priority_queue <int> q;
void init(int N, int A[], int B[]) {
n = N;
for(int i = 1;i <= n;i++) a[i] = {A[i-1],B[i-1]};
sort(a+1,a+n+1);
}
int can(int m,int k[]) {
sort(k,k+m);
int j = 1,g;
while(!q.empty()) q.pop();
for(int i = 0;i < m;i++) {
while(j <= n&&a[j].x <= k[i]) q.push(-a[j++].y);
while(!q.empty()&&-q.top() < k[i]) q.pop();
for(g = 1;!q.empty()&&g <= k[i];g++) q.pop();
if(g != k[i]+1) return false;
}
return true;
}
컴파일 시 표준 에러 (stderr) 메시지
teams.cpp:7: warning: ignoring #pragma gcc optimize [-Wunknown-pragmas]
7 | #pragma gcc optimize("O3")
|
teams.cpp:8: warning: ignoring #pragma gcc optimize [-Wunknown-pragmas]
8 | #pragma gcc optimize("Ofast")
|
teams.cpp:9: warning: ignoring #pragma gcc optimize [-Wunknown-pragmas]
9 | #pragma gcc optimize("unroll-loops")
|
# | 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... |