# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
782748 | Lyrically | 팀들 (IOI15_teams) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pii pair<int,int>
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
int read(){int x;scanf("%lld",&x);return x;}
void print(int x){printf("%lld\n",x);}
void file(string s)
{
freopen((s+".in").c_str(),"r",stdin);
freopen((s+".out").c_str(),"w",stdout);
}
const int mod=998244353;
int n;
struct Item
{
int a,b;
bool operator < (Item c) const
{
return a<c.a;
}
}p[200005];
void init(int N,int A[],int B[])
{
n=N;
rep(i,n){p[i+1].a=A[i];}
rep(i,n){p[i+1].b=B[i];}
sort(p+1,p+n+1);
}
bool fl[200005];
bool can(int m,int t[])
{
sort(t,t+m);
rep1(i,n){fl[i]=0;}
rep(i,m)
{
int cnt=0;
rep1(j,n)
{
if(cnt==t[i]){break;}
if(!fl[j])
{
if(p[i].a<=t[i]&&t[i]<=p[i].b)
{
fl[j]=1;cnt++;
}
}
}
if(cnt!=t[i]){puts("0");return;}
}
puts("1");
}