hiho week 47 register

Ended

Participants:466

Verdict:Accepted
Score:100 / 100
Submitted:2015-05-28 12:59:01

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 <iostream>
#include<string.h>
#include<queue>
#include<cstdio>
using namespace std;
int indegree[100010]={0};
int head[100100]={0};
int p[500100]={0};
int mynext[500100]={0};
int edgecnt=0;
void addedge(int u,int v)
{
    ++edgecnt;
    p[edgecnt]=v;
    mynext[edgecnt]=head[u];
    head[u]=edgecnt;
}
queue<int> que;
int main() {
    int n;
    scanf("%d",&n);
    while(n--)
    {
        int len,count;
        scanf("%d%d",&len,&count);
        edgecnt=0;
        memset(indegree,0,sizeof(indegree));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX