# Bzoj1293 [scoi2009]生日礼物

Posted by yjjr's blog on February 6, 2018

Description

Input

Output

Sample Input

6 3

1 5

2 1 7

3 1 3 8

Sample Output

3

HINT

【数据规模】

Code

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define dep(i,a,b) for(int i=a;i>=b;i--)
#define ll long long
#ifdef WIN32
#define LL "%I64d"
#else
#define LL "%lld"
#endif
using namespace std;
{
ll f=1,x=0;char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
const int maxn=1000006;
struct node{int pos,type;}num[maxn],que[maxn<<1];
inline bool cmp(node a,node b){return a.pos==b.pos?a.type<b.type:a.pos<b.pos;}
void check()
{
rep(j,1,k)
if(!inque[j])return;
flag=1;
}
int main()
{
rep(i,1,k){
}
sort(num+1,num+1+n,cmp);
//rep(i,1,n)cout<<num[i].pos<<' '<<num[i].type<<endl;
{
que[++tail]=num[tail];inque[que[tail].type]=que[tail].pos;
}