QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#617368#9189. Make them Meetwsc200834 1ms4208kbC++172.4kb2024-10-06 15:09:282024-10-06 15:09:28

Judging History

你现在查看的是最新测评结果

  • [2024-10-06 15:09:28]
  • 评测
  • 测评结果:34
  • 用时:1ms
  • 内存:4208kb
  • [2024-10-06 15:09:28]
  • 提交

answer

#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<ll,ll>
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define per(i,a,b) for(ll i=(a);i>=(b);--i)
using namespace std;
bool Mbe;
ll read(){
    ll x=0,f=1;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;
}
void write(ll x){
    if(x<0)putchar('-'),x=-x;
    if(x>9)write(x/10);
    putchar(x%10+'0');
}
const ll N=109;
ll n,m,U[N*N],V[N*N],dep[N],ft[N],id[N],rt;
vector<vector<ll> >res;
vector<ll>to[N];
ll find(ll x){
    return id[x]==x?x:id[x]=find(id[x]);
}
void merge(ll x,ll y){
    x=find(x),y=find(y);
    if(x^y)id[x]=y;
}
void dfs(ll x,ll fa){
    for(ll y:to[x]){
        if(y==fa)continue;
        ft[y]=x,dep[y]=dep[x]+1;
        dfs(y,x);
    }
}
bool Med;
int main(){
    // freopen("meet.in","r",stdin);
    // freopen("meet.out","w",stdout);
    cerr<<fabs(&Med-&Mbe)/1048576.0<<"MB\n";
    n=read(),m=read();
    rep(i,1,m)U[i]=read(),V[i]=read(),to[U[i]].push_back(V[i]),to[V[i]].push_back(U[i]);
    if(m==n*(n-1)/2){
        rep(i,0,2*n-1){
            vector<ll>v(n,0);
            ll c=0;
            if(i&1){
                ll j=0;
                for(;j+1<n;j+=2)v[j]=v[j+1]=c,c++;
                while(j<n)v[j]=c,j++,c++;
            }
            else{
                ll j=1;
                v[0]=0,c++;
                for(;j+1<n;j+=2)v[j]=v[j+1]=c,c++;
                while(j<n)v[j]=c,j++,c++;
            }
            res.push_back(v);
        }
        write(res.size()),putchar('\n');
        for(vector<ll>v:res){
            for(ll x:v)write(x),putchar(' ');
            putchar('\n');
        }
        return 0;
    }
    if(m==n-1){
        dfs(0,-1);
        rep(i,0,3*n-1){
            vector<ll>v(n,0);
            iota(id,id+n,0ll);
            v[0]=to[0][1];
            rep(j,0,n-1){
                if((dep[j]&1)==(i&1))v[j]=j;
                else if(j)v[j]=ft[j];
            }
            res.push_back(v);
        }
        write(res.size()),putchar('\n');
        for(vector<ll>v:res){
            for(ll x:v)write(x),putchar(' ');
            putchar('\n');
        }
        return 0;
    }

    cerr<<"\n"<<clock()*1.0/CLOCKS_PER_SEC*1000<<"ms\n";
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 0ms
memory: 3760kb

input:

2 1
0 1

output:

4
0 1 
0 0 
0 1 
0 0 

result:

points 1.0

Test #2:

score: 10
Accepted
time: 0ms
memory: 3748kb

input:

3 2
0 1
0 2

output:

9
0 0 0 
2 1 2 
0 0 0 
2 1 2 
0 0 0 
2 1 2 
0 0 0 
2 1 2 
0 0 0 

result:

points 1.0

Test #3:

score: 10
Accepted
time: 0ms
memory: 3996kb

input:

4 3
0 1
0 2
0 3

output:

12
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 

result:

points 1.0

Test #4:

score: 10
Accepted
time: 1ms
memory: 4036kb

input:

99 98
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
0 13
0 14
0 15
0 16
0 17
0 18
0 19
0 20
0 21
0 22
0 23
0 24
0 25
0 26
0 27
0 28
0 29
0 30
0 31
0 32
0 33
0 34
0 35
0 36
0 37
0 38
0 39
0 40
0 41
0 42
0 43
0 44
0 45
0 46
0 47
0 48
0 49
0 50
0 51
0 52
0 53
0 54
0 55
0 56
0 57
0 58
0 59
0 60
0 6...

output:

297
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
2 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 32 33 34 35...

result:

points 1.0

Test #5:

score: 10
Accepted
time: 0ms
memory: 3956kb

input:

100 99
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
0 13
0 14
0 15
0 16
0 17
0 18
0 19
0 20
0 21
0 22
0 23
0 24
0 25
0 26
0 27
0 28
0 29
0 30
0 31
0 32
0 33
0 34
0 35
0 36
0 37
0 38
0 39
0 40
0 41
0 42
0 43
0 44
0 45
0 46
0 47
0 48
0 49
0 50
0 51
0 52
0 53
0 54
0 55
0 56
0 57
0 58
0 59
0 60
0 ...

output:

300
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
2 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 32 33 34 ...

result:

points 1.0

Subtask #2:

score: 13
Accepted

Test #6:

score: 13
Accepted
time: 0ms
memory: 3752kb

input:

2 1
0 1

output:

4
0 1 
0 0 
0 1 
0 0 

result:

points 1.0

Test #7:

score: 13
Accepted
time: 0ms
memory: 3768kb

input:

3 3
1 2
0 1
0 2

output:

6
0 1 1 
0 0 1 
0 1 1 
0 0 1 
0 1 1 
0 0 1 

result:

points 1.0

Test #8:

score: 13
Accepted
time: 0ms
memory: 3748kb

input:

4 6
0 1
0 3
2 3
0 2
1 3
1 2

output:

8
0 1 1 2 
0 0 1 1 
0 1 1 2 
0 0 1 1 
0 1 1 2 
0 0 1 1 
0 1 1 2 
0 0 1 1 

result:

points 1.0

Test #9:

score: 13
Accepted
time: 0ms
memory: 3772kb

input:

10 45
4 9
2 8
5 9
1 2
2 9
4 5
5 7
6 7
1 3
1 9
3 4
0 3
4 7
0 6
5 6
7 9
4 8
6 8
0 5
1 8
3 9
1 6
6 9
4 6
0 8
2 3
0 4
0 9
0 7
3 6
0 2
2 5
3 7
3 5
7 8
5 8
8 9
0 1
2 7
1 7
1 4
2 6
2 4
3 8
1 5

output:

20
0 1 1 2 2 3 3 4 4 5 
0 0 1 1 2 2 3 3 4 4 
0 1 1 2 2 3 3 4 4 5 
0 0 1 1 2 2 3 3 4 4 
0 1 1 2 2 3 3 4 4 5 
0 0 1 1 2 2 3 3 4 4 
0 1 1 2 2 3 3 4 4 5 
0 0 1 1 2 2 3 3 4 4 
0 1 1 2 2 3 3 4 4 5 
0 0 1 1 2 2 3 3 4 4 
0 1 1 2 2 3 3 4 4 5 
0 0 1 1 2 2 3 3 4 4 
0 1 1 2 2 3 3 4 4 5 
0 0 1 1 2 2 3 3 4 4 
0 1...

result:

points 1.0

Test #10:

score: 13
Accepted
time: 0ms
memory: 3928kb

input:

15 105
4 10
8 13
0 12
11 12
2 13
8 14
6 10
0 4
8 12
2 12
1 13
5 9
2 8
7 10
6 13
0 13
9 13
7 11
3 13
0 3
4 7
5 13
7 13
0 7
0 11
0 8
0 2
2 4
2 6
6 9
0 1
9 11
1 9
3 14
3 4
10 11
5 10
0 9
3 9
6 11
2 10
5 6
2 5
1 14
6 8
9 12
2 11
9 10
5 12
5 14
4 14
7 14
5 8
5 7
1 12
0 14
7 9
3 11
1 8
0 10
1 3
8 9
4 6
10...

output:

30
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 
0 0 1 1 2 2 3 3 4 ...

result:

points 1.0

Test #11:

score: 13
Accepted
time: 0ms
memory: 3820kb

input:

30 435
5 6
8 11
3 26
8 29
10 22
6 20
18 22
23 27
13 18
2 26
21 25
11 15
25 28
2 22
18 20
3 13
10 19
6 29
10 15
0 13
7 22
13 28
9 16
2 28
6 16
3 17
6 14
4 8
16 17
9 22
22 24
26 29
14 28
19 29
28 29
4 28
13 23
12 19
1 2
5 10
1 6
2 4
25 27
4 22
9 26
16 23
5 16
6 11
0 17
16 27
0 7
15 26
2 16
8 12
1 25
3...

output:

60
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 
0 1 1 2 2 3...

result:

points 1.0

Test #12:

score: 13
Accepted
time: 0ms
memory: 4076kb

input:

40 780
21 24
11 32
12 27
19 20
3 35
25 35
32 35
27 33
0 24
1 3
1 29
14 25
8 30
24 31
14 32
7 12
5 31
28 35
7 10
18 24
13 32
1 26
3 4
10 30
14 38
22 24
9 31
5 10
17 32
2 34
28 39
3 38
13 34
6 10
0 6
9 25
11 14
13 20
10 20
18 28
6 33
34 35
29 33
16 39
4 38
3 24
20 29
17 18
33 36
13 37
24 27
12 33
5 29...

output:

80
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19...

result:

points 1.0

Test #13:

score: 13
Accepted
time: 0ms
memory: 3884kb

input:

50 1225
6 10
14 36
0 34
7 23
22 31
18 34
2 19
13 21
0 46
0 11
2 43
2 11
13 20
13 19
7 39
35 37
9 17
31 38
13 40
7 28
2 41
20 46
25 36
12 39
1 37
21 42
33 48
10 24
13 26
26 37
0 47
17 19
1 28
28 40
15 40
11 22
10 19
24 28
12 28
19 40
6 12
13 48
20 37
11 46
8 19
5 24
16 28
15 47
31 34
11 21
28 33
14 1...

output:

100
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 
0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8...

result:

points 1.0

Test #14:

score: 13
Accepted
time: 1ms
memory: 4208kb

input:

100 4950
24 39
27 46
11 71
57 65
3 8
84 97
74 87
17 49
12 72
1 4
22 83
29 42
28 65
39 89
29 92
26 78
45 53
18 44
33 43
14 98
50 66
21 95
32 67
21 33
21 80
59 77
70 85
13 16
0 41
31 65
51 80
22 80
30 79
55 75
54 82
29 57
72 97
31 85
86 87
60 90
1 17
65 81
13 15
44 71
58 88
65 87
8 31
77 99
4 44
29 43...

output:

200
0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 33 34 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 49 50 
0 0 1 1 2 2 3 ...

result:

points 1.0

Subtask #3:

score: 11
Accepted

Test #15:

score: 11
Accepted
time: 0ms
memory: 3920kb

input:

2 1
0 1

output:

4
0 1 
0 0 
0 1 
0 0 

result:

points 1.0

Test #16:

score: 11
Accepted
time: 0ms
memory: 3696kb

input:

3 2
0 1
1 2

output:

9
0 0 2 
0 1 1 
0 0 2 
0 1 1 
0 0 2 
0 1 1 
0 0 2 
0 1 1 
0 0 2 

result:

points 1.0

Test #17:

score: 11
Accepted
time: 0ms
memory: 3884kb

input:

4 3
0 1
1 2
2 3

output:

12
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 

result:

points 1.0

Test #18:

score: 11
Accepted
time: 0ms
memory: 3788kb

input:

49 48
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48

output:

147
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 
0 1 1 3 3 5 5 7 7 9 9 11 11 13 13 15 15 17 17 19 19 21 21 23 23 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 41 41 43 43 45 45 47 47 
0 0 2 2 4 4 6 6 8 8 1...

result:

points 1.0

Test #19:

score: 11
Accepted
time: 1ms
memory: 3992kb

input:

99 98
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
5...

output:

297
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 48 50 50 52 52 54 54 56 56 58 58 60 60 62 62 64 64 66 66 68 68 70 70 72 72 74 74 76 76 78 78 80 80 82 82 84 84 86 86 88 88 90 90 92 92 94 94 96 96 98 
0 1 1 3 ...

result:

points 1.0

Test #20:

score: 11
Accepted
time: 1ms
memory: 4064kb

input:

100 99
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
...

output:

300
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 48 50 50 52 52 54 54 56 56 58 58 60 60 62 62 64 64 66 66 68 68 70 70 72 72 74 74 76 76 78 78 80 80 82 82 84 84 86 86 88 88 90 90 92 92 94 94 96 96 98 98 
0 1 1...

result:

points 1.0

Test #21:

score: 11
Accepted
time: 1ms
memory: 3860kb

input:

64 63
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
5...

output:

192
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 48 50 50 52 52 54 54 56 56 58 58 60 60 62 62 
0 1 1 3 3 5 5 7 7 9 9 11 11 13 13 15 15 17 17 19 19 21 21 23 23 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 4...

result:

points 1.0

Subtask #4:

score: 0
Wrong Answer

Dependency #1:

100%
Accepted

Dependency #3:

100%
Accepted

Test #22:

score: 36
Accepted
time: 0ms
memory: 3808kb

input:

2 1
0 1

output:

4
0 1 
0 0 
0 1 
0 0 

result:

points 1.0

Test #23:

score: 36
Accepted
time: 0ms
memory: 3916kb

input:

3 2
0 1
0 2

output:

9
0 0 0 
2 1 2 
0 0 0 
2 1 2 
0 0 0 
2 1 2 
0 0 0 
2 1 2 
0 0 0 

result:

points 1.0

Test #24:

score: 36
Accepted
time: 0ms
memory: 3864kb

input:

4 3
0 1
0 2
0 3

output:

12
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 
0 0 0 0 
2 1 2 3 

result:

points 1.0

Test #25:

score: 36
Accepted
time: 0ms
memory: 4172kb

input:

99 98
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
0 13
0 14
0 15
0 16
0 17
0 18
0 19
0 20
0 21
0 22
0 23
0 24
0 25
0 26
0 27
0 28
0 29
0 30
0 31
0 32
0 33
0 34
0 35
0 36
0 37
0 38
0 39
0 40
0 41
0 42
0 43
0 44
0 45
0 46
0 47
0 48
0 49
0 50
0 51
0 52
0 53
0 54
0 55
0 56
0 57
0 58
0 59
0 60
0 6...

output:

297
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
2 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 32 33 34 35...

result:

points 1.0

Test #26:

score: 36
Accepted
time: 1ms
memory: 4088kb

input:

100 99
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
0 13
0 14
0 15
0 16
0 17
0 18
0 19
0 20
0 21
0 22
0 23
0 24
0 25
0 26
0 27
0 28
0 29
0 30
0 31
0 32
0 33
0 34
0 35
0 36
0 37
0 38
0 39
0 40
0 41
0 42
0 43
0 44
0 45
0 46
0 47
0 48
0 49
0 50
0 51
0 52
0 53
0 54
0 55
0 56
0 57
0 58
0 59
0 60
0 ...

output:

300
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
2 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 32 33 34 ...

result:

points 1.0

Test #27:

score: 36
Accepted
time: 0ms
memory: 3828kb

input:

3 2
0 1
1 2

output:

9
0 0 2 
0 1 1 
0 0 2 
0 1 1 
0 0 2 
0 1 1 
0 0 2 
0 1 1 
0 0 2 

result:

points 1.0

Test #28:

score: 36
Accepted
time: 0ms
memory: 3760kb

input:

4 3
0 1
1 2
2 3

output:

12
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 
0 0 2 2 
0 1 1 3 

result:

points 1.0

Test #29:

score: 36
Accepted
time: 0ms
memory: 3824kb

input:

49 48
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48

output:

147
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 
0 1 1 3 3 5 5 7 7 9 9 11 11 13 13 15 15 17 17 19 19 21 21 23 23 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 41 41 43 43 45 45 47 47 
0 0 2 2 4 4 6 6 8 8 1...

result:

points 1.0

Test #30:

score: 36
Accepted
time: 1ms
memory: 4060kb

input:

99 98
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
5...

output:

297
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 48 50 50 52 52 54 54 56 56 58 58 60 60 62 62 64 64 66 66 68 68 70 70 72 72 74 74 76 76 78 78 80 80 82 82 84 84 86 86 88 88 90 90 92 92 94 94 96 96 98 
0 1 1 3 ...

result:

points 1.0

Test #31:

score: 36
Accepted
time: 1ms
memory: 4016kb

input:

100 99
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
...

output:

300
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 48 50 50 52 52 54 54 56 56 58 58 60 60 62 62 64 64 66 66 68 68 70 70 72 72 74 74 76 76 78 78 80 80 82 82 84 84 86 86 88 88 90 90 92 92 94 94 96 96 98 98 
0 1 1...

result:

points 1.0

Test #32:

score: 36
Accepted
time: 1ms
memory: 3848kb

input:

64 63
0 1
1 2
2 3
3 4
4 5
5 6
6 7
7 8
8 9
9 10
10 11
11 12
12 13
13 14
14 15
15 16
16 17
17 18
18 19
19 20
20 21
21 22
22 23
23 24
24 25
25 26
26 27
27 28
28 29
29 30
30 31
31 32
32 33
33 34
34 35
35 36
36 37
37 38
38 39
39 40
40 41
41 42
42 43
43 44
44 45
45 46
46 47
47 48
48 49
49 50
50 51
51 52
5...

output:

192
0 0 2 2 4 4 6 6 8 8 10 10 12 12 14 14 16 16 18 18 20 20 22 22 24 24 26 26 28 28 30 30 32 32 34 34 36 36 38 38 40 40 42 42 44 44 46 46 48 48 50 50 52 52 54 54 56 56 58 58 60 60 62 62 
0 1 1 3 3 5 5 7 7 9 9 11 11 13 13 15 15 17 17 19 19 21 21 23 23 25 25 27 27 29 29 31 31 33 33 35 35 37 37 39 39 4...

result:

points 1.0

Test #33:

score: 36
Accepted
time: 0ms
memory: 3996kb

input:

5 4
2 1
3 2
4 1
1 0

output:

15
0 0 2 2 4 
0 1 1 3 1 
0 0 2 2 4 
0 1 1 3 1 
0 0 2 2 4 
0 1 1 3 1 
0 0 2 2 4 
0 1 1 3 1 
0 0 2 2 4 
0 1 1 3 1 
0 0 2 2 4 
0 1 1 3 1 
0 0 2 2 4 
0 1 1 3 1 
0 0 2 2 4 

result:

points 1.0

Test #34:

score: 36
Accepted
time: 0ms
memory: 3836kb

input:

10 9
3 0
5 0
9 6
4 2
8 1
6 1
2 1
1 0
7 0

output:

30
0 0 2 0 2 0 6 0 8 6 
5 1 1 3 4 5 1 7 1 9 
0 0 2 0 2 0 6 0 8 6 
5 1 1 3 4 5 1 7 1 9 
0 0 2 0 2 0 6 0 8 6 
5 1 1 3 4 5 1 7 1 9 
0 0 2 0 2 0 6 0 8 6 
5 1 1 3 4 5 1 7 1 9 
0 0 2 0 2 0 6 0 8 6 
5 1 1 3 4 5 1 7 1 9 
0 0 2 0 2 0 6 0 8 6 
5 1 1 3 4 5 1 7 1 9 
0 0 2 0 2 0 6 0 8 6 
5 1 1 3 4 5 1 7 1 9 
0 0...

result:

points 1.0

Test #35:

score: 36
Accepted
time: 0ms
memory: 3696kb

input:

11 10
2 0
8 6
1 0
5 3
9 7
7 5
4 3
6 5
10 9
3 1

output:

33
0 0 0 3 3 3 6 7 6 7 10 
1 1 2 1 4 5 5 5 8 9 9 
0 0 0 3 3 3 6 7 6 7 10 
1 1 2 1 4 5 5 5 8 9 9 
0 0 0 3 3 3 6 7 6 7 10 
1 1 2 1 4 5 5 5 8 9 9 
0 0 0 3 3 3 6 7 6 7 10 
1 1 2 1 4 5 5 5 8 9 9 
0 0 0 3 3 3 6 7 6 7 10 
1 1 2 1 4 5 5 5 8 9 9 
0 0 0 3 3 3 6 7 6 7 10 
1 1 2 1 4 5 5 5 8 9 9 
0 0 0 3 3 3 6 7...

result:

points 1.0

Test #36:

score: 36
Accepted
time: 1ms
memory: 4064kb

input:

100 99
2 1
91 16
24 19
45 0
55 9
21 19
7 2
97 9
40 3
61 47
34 9
36 10
27 0
73 24
53 6
79 67
51 4
18 3
25 5
67 26
15 9
82 65
19 17
43 11
92 36
62 29
59 20
22 0
32 21
66 25
50 19
5 0
23 7
78 64
42 28
28 6
8 1
98 94
10 8
84 50
88 0
87 51
89 61
72 28
14 6
63 31
33 23
57 38
11 9
38 33
16 2
86 8
69 66
54 ...

output:

300
0 0 2 3 0 0 3 2 8 3 8 11 12 13 14 15 2 17 3 17 17 21 0 23 24 25 26 0 28 29 30 31 21 23 34 3 36 37 38 15 3 25 28 11 17 0 8 47 48 49 50 51 15 53 54 55 14 38 58 59 60 47 29 31 15 65 25 26 68 69 69 71 28 24 74 23 14 30 78 79 80 81 65 2 50 85 8 51 0 89 90 91 36 93 55 91 24 97 98 99 
27 1 1 1 4 5 6 7 ...

result:

points 1.0

Test #37:

score: 36
Accepted
time: 1ms
memory: 4172kb

input:

100 99
65 64
90 89
96 95
29 28
61 60
50 49
95 93
37 36
42 40
45 43
94 93
16 15
8 7
67 66
54 52
15 13
38 37
77 76
1 0
89 88
39 37
21 20
63 62
49 48
58 56
53 51
10 9
46 44
9 7
20 19
70 69
73 71
56 54
57 56
24 23
48 46
60 58
83 82
6 4
34 33
12 11
19 18
82 81
23 21
55 53
41 39
18 17
91 89
14 12
26 25
64...

output:

300
0 0 0 3 3 3 6 7 7 7 10 11 11 13 14 13 16 17 17 19 19 21 21 21 24 24 26 27 27 29 29 29 32 33 33 33 36 36 38 39 39 39 42 42 44 45 44 45 48 48 50 51 51 51 54 55 54 57 58 57 58 61 62 62 62 65 66 66 66 69 69 69 72 73 73 75 75 77 77 79 80 80 82 82 84 84 86 86 86 89 89 89 92 92 94 95 95 97 98 97 
2 1 2...

result:

points 1.0

Test #38:

score: 36
Accepted
time: 1ms
memory: 4004kb

input:

100 99
11 8
17 16
98 95
89 86
53 51
88 86
63 62
15 12
83 82
73 72
97 96
5 4
6 5
51 49
16 13
81 78
94 93
25 22
70 68
23 21
44 41
74 73
2 1
28 27
37 36
30 27
35 32
77 76
50 49
22 19
82 79
85 83
45 44
95 94
24 23
10 9
21 20
72 69
78 75
43 40
39 38
19 17
42 41
52 50
34 32
62 61
65 62
79 76
90 89
69 66
4...

output:

300
0 0 2 0 4 4 6 4 6 6 10 11 10 11 14 15 16 16 16 19 19 21 19 21 24 25 26 25 28 28 30 28 32 33 32 32 36 36 38 38 38 38 42 43 44 44 44 47 47 49 49 49 52 53 54 52 53 57 58 57 58 61 61 63 63 65 66 66 66 66 70 71 72 72 74 75 75 77 75 79 79 81 79 83 83 83 86 87 86 86 90 91 92 91 94 94 96 96 98 96 
1 1 1...

result:

points 1.0

Test #39:

score: 36
Accepted
time: 1ms
memory: 4180kb

input:

100 99
82 47
37 20
37 44
37 86
37 56
99 58
80 13
56 39
37 93
37 64
3 73
53 32
91 75
97 78
37 30
59 90
15 22
37 52
37 79
25 4
37 71
37 3
37 51
12 2
37 91
37 34
37 38
37 36
37 40
95 67
37 28
14 83
42 26
37 14
37 9
37 42
34 74
37 72
1 81
86 7
98 87
29 17
37 31
92 62
79 45
37 59
31 50
20 96
69 24
37 97
...

output:

300
0 37 2 37 4 5 6 7 8 37 10 11 37 13 37 37 16 17 37 37 37 37 22 37 24 37 26 37 37 37 37 37 32 33 37 35 37 37 37 39 37 41 37 43 37 45 37 47 0 49 50 37 37 37 54 55 37 57 58 37 60 37 62 63 37 37 66 67 68 37 70 37 37 73 74 75 37 37 78 37 37 81 37 83 84 85 37 87 37 89 90 37 37 37 94 37 96 37 37 37 
0 1...

result:

points 1.0

Test #40:

score: 36
Accepted
time: 1ms
memory: 4008kb

input:

100 99
61 80
7 74
86 22
54 45
71 97
33 37
71 49
71 59
0 79
14 5
88 86
6 92
48 18
52 15
20 81
62 61
63 52
78 1
85 93
24 48
96 0
50 88
82 53
68 36
16 34
95 21
81 58
87 90
60 26
28 68
90 73
21 19
71 43
83 84
71 63
76 6
71 24
1 39
67 55
44 3
65 31
64 78
19 83
32 65
35 47
89 38
37 25
94 41
43 62
5 46
71 ...

output:

300
0 78 2 44 4 5 6 51 8 98 17 12 12 13 75 15 16 17 18 21 55 21 22 30 24 25 60 27 28 42 30 65 15 33 16 8 36 33 89 39 2 94 42 43 44 45 5 47 24 49 49 51 63 53 4 55 59 22 81 59 60 61 43 63 97 65 18 13 28 36 70 72 72 90 74 75 45 74 78 0 61 81 53 83 83 85 88 70 88 89 90 27 6 85 94 25 0 97 98 39 
96 1 79 ...

result:

points 1.0

Test #41:

score: 36
Accepted
time: 1ms
memory: 4076kb

input:

100 99
8 3
47 1
50 49
4 1
89 88
84 83
68 67
34 19
40 35
77 76
12 6
52 51
71 70
66 65
97 96
33 1
53 52
83 82
51 50
79 78
43 7
91 90
92 91
62 61
49 28
31 9
96 95
42 0
82 81
36 34
5 2
58 57
15 5
72 71
29 25
54 53
93 92
95 94
59 58
76 75
65 64
55 54
74 73
2 1
18 11
27 0
14 10
13 10
69 68
39 0
85 84
81 8...

output:

300
0 0 2 3 4 2 0 3 3 2 0 11 12 13 14 15 2 17 11 15 20 21 22 23 3 14 26 0 28 29 30 31 13 33 34 3 34 0 17 0 40 28 0 43 44 40 46 47 33 28 50 50 52 52 54 54 56 56 58 58 60 60 62 62 64 64 66 66 68 68 70 70 72 72 74 74 76 76 78 78 80 80 82 82 84 84 86 86 88 88 90 90 92 92 94 94 96 96 98 98 
27 1 1 1 1 5 ...

result:

points 1.0

Test #42:

score: 36
Accepted
time: 1ms
memory: 4028kb

input:

100 99
79 78
39 33
3 1
23 19
2 0
31 23
26 18
33 24
86 85
25 20
83 82
1 0
60 59
14 10
29 25
17 8
7 5
68 67
34 28
58 57
84 83
48 46
90 89
54 53
12 3
50 49
9 1
64 63
24 18
95 94
41 34
99 98
97 96
4 2
87 86
10 9
56 55
51 50
5 1
11 8
65 64
98 97
52 51
16 14
37 31
80 79
67 66
8 4
42 32
93 92
73 72
15 6
82...

output:

300
0 0 0 3 4 5 6 5 4 9 9 11 3 4 14 6 14 17 18 18 20 21 22 23 18 20 18 27 23 29 27 23 32 33 34 35 29 37 35 33 40 34 32 33 44 37 46 47 46 40 50 50 52 52 54 54 56 56 58 58 60 60 62 62 64 64 66 66 68 68 70 70 72 72 74 74 76 76 78 78 80 80 82 82 84 84 86 86 88 88 90 90 92 92 94 94 96 96 98 98 
1 1 2 1 2...

result:

points 1.0

Test #43:

score: 0
Wrong Answer
time: 1ms
memory: 3976kb

input:

100 99
99 98
74 73
40 38
38 37
80 79
48 46
29 26
3 1
37 34
17 15
62 61
30 27
81 80
8 6
45 42
76 75
88 87
32 30
31 29
75 74
34 33
83 82
16 14
14 11
73 72
96 95
12 11
95 94
68 67
67 66
26 25
2 1
19 18
49 47
20 17
85 84
57 56
28 26
63 62
64 63
10 8
71 70
13 10
69 68
53 52
35 32
33 31
55 54
46 43
54 53
...

output:

300
0 0 2 3 4 4 3 4 8 9 8 11 11 13 11 15 16 15 16 19 20 20 22 20 24 25 25 24 28 29 30 29 30 33 33 35 36 37 37 39 40 41 41 41 41 45 46 46 46 49 49 51 51 53 53 55 55 57 57 59 59 61 61 63 63 65 65 67 67 69 69 71 71 73 73 75 75 77 77 79 79 81 81 83 83 85 85 87 87 89 89 91 91 93 93 95 95 97 97 99 
0 1 1 ...

result:

wrong answer If people start at 0 and 2, then they can avoid each other

Subtask #5:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%