hiho week 48 register

Ended

Participants:456

Verdict:Accepted
Score:100 / 100
Submitted:2015-06-02 16:27:04

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <cstdlib>
#include <cstdio>
#include <cstring>
#define NMAX 100100
#define MMAX 500100
#define MAXCOUNT 142857
int head[NMAX];//
int paths[MMAX][2];//to, nextno
int waitqueue[NMAX];//[no pre next]  first row is head
int status[NMAX];  
int num[NMAX];
int p,we,ws;
int N,M,K;
int total;
char ch;void F(int &aa)// not used for negative integer
{
    aa=0;
    while(ch=getchar(),(ch<'0'||ch>'9'));
    while(ch>='0'&&ch<='9') {aa=(aa<<3)+(aa<<1)+ch-'0';ch=getchar();}
}
void AddPath(int u,int v)
{
        paths[++p][0]=v;
        paths[p][1]=head[u];
        head[u]=p;
}
void RemovePath(int u)
{
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX