QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#411077#6663. 회의실 2bachbeo200741 237ms57276kbC++202.0kb2024-05-14 21:43:462024-05-14 21:43:46

Judging History

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

  • [2024-05-14 21:43:46]
  • 评测
  • 测评结果:41
  • 用时:237ms
  • 内存:57276kb
  • [2024-05-14 21:43:46]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

const int maxn = 2005;
const int mod = 1e9+7;
#define pii pair<int,int>
#define fi first
#define se second
int power(int a,int n){
    int res=1;
    while(n){
        if(n&1) res=1LL*res*a%mod;
        a=1LL*a*a%mod;n>>=1;
    }
    return res;
}

int fac[maxn],dfac[maxn];
void combi(int N){
    fac[0]=1;
    for(int i=1;i<=N;i++) fac[i]=1LL*fac[i-1]*i%mod;
    dfac[N]=power(fac[N],mod-2);
    for(int i=N;i>=1;i--) dfac[i-1]=1LL*dfac[i]*i%mod;
    //cout << dfac[2] << '\n';
}

int rt[2*maxn],num[maxn];
int cnt[2*maxn][2*maxn],dp[2*maxn][2*maxn];
vector<int> lt[2*maxn];

int count_removals(std::vector<int> S, std::vector<int> E){
	int N = S.size();combi(N);
    for(int i=0;i<N;i++){
        cnt[S[i]][E[i]]++;
        rt[S[i]]=max(rt[S[i]],E[i]);
        lt[E[i]].push_back(S[i]);
    }
    for(int l=2*N;l>=1;l--) for(int r=l+1;r<=2*N;r++) cnt[l][r]+=cnt[l+1][r]+cnt[l][r-1]-cnt[l+1][r-1];

    int cc=0,mx=0;
    vector<pii> p;
    for(int i=1;i<=2*N;i++){
        if(mx<i){
            if(cnt[cc][mx]) p.push_back({cc,mx});
            cc=mx=i;
        }
        mx=max(mx,rt[i]);
    }
    if(cnt[cc][mx]) p.push_back({cc,mx});

    int res=1,M;
    for(auto [L,R]:p){
        num[M=cnt[L][R]]++;
        vector<pii> range;
        for(int i=L;i<=R;i++) for(int j:lt[i]){
            range.push_back({j,i});
            dp[j][i]=1LL*fac[M-1]*dfac[M-cnt[j][i]]%mod;
        }
        for(int len=1;len<=R-L;len++){
            for(int l=L;l<=R-len+1;l++){
                int r=l+len-1;
                for(auto [cl,cr]:range){
                    if(cl>r || cr<l || (l<=cl && cr<=r)) continue;
                    cl=min(cl,l);cr=max(cr,r);
                    dp[cl][cr]=(dp[cl][cr]+1LL*dp[l][r]*fac[M-cnt[l][r]-1]%mod*dfac[M-cnt[cl][cr]]%mod)%mod;
                }
            }
        }

        res=1LL*res*dp[L][R]%mod;
    }
    for(int i=1;i<=N;i++) res=1LL*res*fac[num[i]]%mod;
	return res;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 3
Accepted

Test #1:

score: 3
Accepted
time: 0ms
memory: 3756kb

input:

2
1 4
2 3

output:

Meeting 2 - By moonrabbit2
My answer is: 2

result:

ok 2 lines

Test #2:

score: 3
Accepted
time: 1ms
memory: 4108kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 845040

result:

ok 2 lines

Test #3:

score: 3
Accepted
time: 0ms
memory: 3856kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 3628800

result:

ok 2 lines

Test #4:

score: 3
Accepted
time: 1ms
memory: 3752kb

input:

4
1 2
3 4
5 6
7 8

output:

Meeting 2 - By moonrabbit2
My answer is: 24

result:

ok 2 lines

Test #5:

score: 3
Accepted
time: 0ms
memory: 3728kb

input:

2
1 2
3 4

output:

Meeting 2 - By moonrabbit2
My answer is: 2

result:

ok 2 lines

Test #6:

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

input:

2
1 3
2 4

output:

Meeting 2 - By moonrabbit2
My answer is: 2

result:

ok 2 lines

Test #7:

score: 3
Accepted
time: 1ms
memory: 3856kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 13280

result:

ok 2 lines

Test #8:

score: 3
Accepted
time: 1ms
memory: 3956kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 1797408

result:

ok 2 lines

Test #9:

score: 3
Accepted
time: 1ms
memory: 3920kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 647760

result:

ok 2 lines

Test #10:

score: 3
Accepted
time: 1ms
memory: 3808kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 3261600

result:

ok 2 lines

Test #11:

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

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 2193120

result:

ok 2 lines

Test #12:

score: 3
Accepted
time: 1ms
memory: 3880kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 2490480

result:

ok 2 lines

Test #13:

score: 3
Accepted
time: 1ms
memory: 4112kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 3054720

result:

ok 2 lines

Test #14:

score: 3
Accepted
time: 1ms
memory: 4116kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 2432160

result:

ok 2 lines

Test #15:

score: 3
Accepted
time: 0ms
memory: 3888kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 1242900

result:

ok 2 lines

Test #16:

score: 3
Accepted
time: 1ms
memory: 3872kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 1716480

result:

ok 2 lines

Test #17:

score: 3
Accepted
time: 1ms
memory: 3884kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 1035760

result:

ok 2 lines

Test #18:

score: 3
Accepted
time: 1ms
memory: 4108kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 770400

result:

ok 2 lines

Test #19:

score: 3
Accepted
time: 1ms
memory: 3872kb

input:

9
1 18
4 6
12 17
7 9
14 15
11 13
10 16
5 8
2 3

output:

Meeting 2 - By moonrabbit2
My answer is: 94080

result:

ok 2 lines

Subtask #2:

score: 8
Accepted

Dependency #1:

100%
Accepted

Test #20:

score: 8
Accepted
time: 1ms
memory: 4220kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 146326063

result:

ok 2 lines

Test #21:

score: 8
Accepted
time: 1ms
memory: 4268kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 114632607

result:

ok 2 lines

Test #22:

score: 8
Accepted
time: 1ms
memory: 4292kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 524288

result:

ok 2 lines

Test #23:

score: 8
Accepted
time: 1ms
memory: 4056kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 135122973

result:

ok 2 lines

Test #24:

score: 8
Accepted
time: 0ms
memory: 4048kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 498214363

result:

ok 2 lines

Test #25:

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

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 644114283

result:

ok 2 lines

Test #26:

score: 8
Accepted
time: 0ms
memory: 3984kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 146326063

result:

ok 2 lines

Test #27:

score: 8
Accepted
time: 1ms
memory: 4044kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 322126540

result:

ok 2 lines

Test #28:

score: 8
Accepted
time: 1ms
memory: 4240kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 469150957

result:

ok 2 lines

Test #29:

score: 8
Accepted
time: 1ms
memory: 3928kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 859543975

result:

ok 2 lines

Test #30:

score: 8
Accepted
time: 1ms
memory: 4252kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 659775882

result:

ok 2 lines

Test #31:

score: 8
Accepted
time: 1ms
memory: 4044kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 308501386

result:

ok 2 lines

Test #32:

score: 8
Accepted
time: 1ms
memory: 4284kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 515850412

result:

ok 2 lines

Test #33:

score: 8
Accepted
time: 1ms
memory: 4200kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 146326063

result:

ok 2 lines

Test #34:

score: 8
Accepted
time: 1ms
memory: 4240kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 422082124

result:

ok 2 lines

Test #35:

score: 8
Accepted
time: 0ms
memory: 4100kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 578181703

result:

ok 2 lines

Test #36:

score: 8
Accepted
time: 1ms
memory: 4000kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 977025791

result:

ok 2 lines

Test #37:

score: 8
Accepted
time: 0ms
memory: 4108kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 68177995

result:

ok 2 lines

Test #38:

score: 8
Accepted
time: 1ms
memory: 4252kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 483071954

result:

ok 2 lines

Test #39:

score: 8
Accepted
time: 1ms
memory: 4280kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 467776800

result:

ok 2 lines

Test #40:

score: 8
Accepted
time: 1ms
memory: 3984kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 326007413

result:

ok 2 lines

Test #41:

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

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 481947415

result:

ok 2 lines

Test #42:

score: 8
Accepted
time: 1ms
memory: 4024kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 720719349

result:

ok 2 lines

Test #43:

score: 8
Accepted
time: 0ms
memory: 3980kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 523653120

result:

ok 2 lines

Test #44:

score: 8
Accepted
time: 0ms
memory: 3964kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 24551424

result:

ok 2 lines

Test #45:

score: 8
Accepted
time: 1ms
memory: 3988kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 216831020

result:

ok 2 lines

Test #46:

score: 8
Accepted
time: 1ms
memory: 4216kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 33758208

result:

ok 2 lines

Test #47:

score: 8
Accepted
time: 1ms
memory: 4000kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 409620459

result:

ok 2 lines

Test #48:

score: 8
Accepted
time: 1ms
memory: 4244kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 696415657

result:

ok 2 lines

Test #49:

score: 8
Accepted
time: 1ms
memory: 3952kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 4644864

result:

ok 2 lines

Test #50:

score: 8
Accepted
time: 1ms
memory: 3984kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 71526197

result:

ok 2 lines

Test #51:

score: 8
Accepted
time: 1ms
memory: 4220kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 441494501

result:

ok 2 lines

Test #52:

score: 8
Accepted
time: 1ms
memory: 4192kb

input:

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

output:

Meeting 2 - By moonrabbit2
My answer is: 606916381

result:

ok 2 lines

Subtask #3:

score: 30
Accepted

Dependency #2:

100%
Accepted

Test #53:

score: 30
Accepted
time: 3ms
memory: 8036kb

input:

300
267 268
101 102
591 592
277 278
283 284
475 476
207 208
119 120
583 584
145 146
155 156
57 58
53 54
505 506
383 384
527 528
71 72
333 334
373 374
389 390
337 338
349 350
497 498
405 406
465 466
99 100
569 570
133 134
265 266
437 438
507 508
291 292
49 50
195 196
227 228
327 328
479 480
581 582
3...

output:

Meeting 2 - By moonrabbit2
My answer is: 419467694

result:

ok 2 lines

Test #54:

score: 30
Accepted
time: 41ms
memory: 9956kb

input:

300
460 461
150 151
4 5
344 345
272 273
140 141
472 473
502 503
50 51
284 285
452 453
376 377
426 427
324 325
186 187
194 195
68 69
228 229
102 103
598 599
250 251
402 403
42 43
308 309
274 275
76 77
312 313
562 563
156 157
82 83
370 371
534 535
1 600
128 129
254 255
526 527
252 253
294 295
58 59
32...

output:

Meeting 2 - By moonrabbit2
My answer is: 56129785

result:

ok 2 lines

Test #55:

score: 30
Accepted
time: 48ms
memory: 9980kb

input:

300
70 73
366 369
78 81
238 241
308 311
140 143
302 305
332 335
382 385
442 445
482 485
392 395
296 299
338 341
102 105
50 53
276 279
426 429
578 581
40 43
18 21
10 13
470 473
462 465
20 23
248 251
106 109
458 461
572 575
250 253
336 339
508 511
484 487
354 357
174 177
556 559
52 55
242 245
202 205
...

output:

Meeting 2 - By moonrabbit2
My answer is: 661025383

result:

ok 2 lines

Test #56:

score: 30
Accepted
time: 44ms
memory: 10180kb

input:

300
172 173
544 547
76 77
274 275
532 533
166 175
152 153
420 423
368 375
28 41
188 195
540 541
30 31
326 327
94 97
54 57
106 107
514 515
322 323
314 333
104 111
88 89
466 467
408 421
8 9
422 425
250 253
178 179
446 449
134 139
556 557
120 125
418 419
526 527
536 537
442 447
494 495
156 163
438 441
...

output:

Meeting 2 - By moonrabbit2
My answer is: 667135203

result:

ok 2 lines

Test #57:

score: 30
Accepted
time: 52ms
memory: 10024kb

input:

300
407 408
555 582
30 37
465 468
442 471
162 163
300 301
252 255
585 586
528 547
455 458
80 83
279 280
426 433
574 575
549 550
140 157
548 551
429 430
3 290
331 332
229 234
515 516
340 359
439 508
472 477
7 58
487 488
76 79
51 52
73 86
540 541
294 319
242 243
292 329
342 343
209 210
438 583
414 417...

output:

Meeting 2 - By moonrabbit2
My answer is: 916976953

result:

ok 2 lines

Test #58:

score: 30
Accepted
time: 51ms
memory: 10028kb

input:

300
44 45
587 590
234 247
9 14
6 41
86 95
269 272
513 514
7 28
252 281
19 20
377 384
309 310
543 546
408 413
157 158
356 357
501 502
305 308
156 161
517 518
500 505
104 107
444 445
122 191
368 369
470 471
63 66
290 291
219 220
139 168
210 211
124 127
116 117
549 552
33 34
227 228
323 326
569 570
424...

output:

Meeting 2 - By moonrabbit2
My answer is: 442816506

result:

ok 2 lines

Test #59:

score: 30
Accepted
time: 217ms
memory: 8432kb

input:

300
142 459
27 574
295 306
180 421
240 361
143 458
30 571
201 400
170 431
97 504
2 599
140 461
298 303
234 367
68 533
148 453
47 554
260 341
193 408
289 312
161 440
85 516
70 531
7 594
50 551
222 379
254 347
154 447
38 563
155 446
118 483
58 543
227 374
42 559
63 538
122 479
164 437
77 524
243 358
4...

output:

Meeting 2 - By moonrabbit2
My answer is: 419467694

result:

ok 2 lines

Test #60:

score: 30
Accepted
time: 206ms
memory: 9116kb

input:

300
182 458
59 308
36 264
234 508
52 295
306 548
90 350
413 583
167 444
34 262
159 438
156 434
201 474
240 512
153 429
113 381
221 491
68 320
102 368
70 323
18 194
244 515
14 176
278 535
138 410
289 542
150 425
124 395
484 594
29 241
78 336
187 463
67 319
60 312
170 447
400 580
118 390
47 286
85 347...

output:

Meeting 2 - By moonrabbit2
My answer is: 265874363

result:

ok 2 lines

Test #61:

score: 30
Accepted
time: 204ms
memory: 9332kb

input:

300
142 421
160 444
165 449
8 173
131 407
205 487
61 310
97 365
394 580
223 500
419 584
230 504
161 445
267 526
254 519
49 286
208 488
283 535
236 509
199 481
261 522
118 391
85 344
361 568
64 313
146 425
228 503
62 311
468 596
88 350
271 529
185 470
258 521
215 493
41 266
191 475
450 592
35 257
34 ...

output:

Meeting 2 - By moonrabbit2
My answer is: 699519273

result:

ok 2 lines

Test #62:

score: 30
Accepted
time: 185ms
memory: 9564kb

input:

300
338 543
326 539
430 578
85 320
228 472
16 142
268 507
78 309
26 182
481 588
428 577
69 296
49 244
129 376
106 349
284 519
263 501
455 583
236 479
111 353
82 316
17 152
25 181
98 337
269 508
233 477
195 442
7 100
168 425
179 435
272 511
119 362
310 534
11 115
103 345
415 574
163 420
270 509
2 45
...

output:

Meeting 2 - By moonrabbit2
My answer is: 374793370

result:

ok 2 lines

Test #63:

score: 30
Accepted
time: 177ms
memory: 9580kb

input:

300
130 371
365 553
268 487
346 544
13 116
341 542
251 480
256 481
343 543
291 509
104 336
53 236
289 507
3 70
102 334
304 516
320 524
16 131
171 410
168 407
386 558
300 513
118 359
39 201
240 470
284 501
148 388
24 160
238 469
269 489
91 311
86 297
204 438
37 198
467 583
324 526
288 506
35 192
194 ...

output:

Meeting 2 - By moonrabbit2
My answer is: 441857323

result:

ok 2 lines

Test #64:

score: 30
Accepted
time: 141ms
memory: 9852kb

input:

300
462 574
279 463
89 212
223 405
559 596
48 132
80 190
155 321
111 253
310 487
143 307
325 501
73 179
28 85
218 400
221 401
293 474
540 593
188 370
20 62
348 518
415 552
382 536
170 351
491 582
314 492
301 482
255 436
244 431
452 566
112 254
119 268
336 505
33 93
345 516
174 358
217 399
539 592
33...

output:

Meeting 2 - By moonrabbit2
My answer is: 556759219

result:

ok 2 lines

Test #65:

score: 30
Accepted
time: 145ms
memory: 9588kb

input:

300
383 542
463 575
311 482
347 515
509 590
39 113
88 201
510 591
344 512
242 423
207 387
474 581
400 549
54 145
210 391
432 564
194 379
427 562
220 401
312 483
370 533
363 525
95 209
9 24
507 589
414 555
406 551
212 392
178 349
243 424
111 238
92 206
112 239
303 477
261 441
278 451
473 579
430 563
...

output:

Meeting 2 - By moonrabbit2
My answer is: 298765237

result:

ok 2 lines

Test #66:

score: 30
Accepted
time: 237ms
memory: 8216kb

input:

300
54 354
130 430
34 334
169 469
61 361
38 338
257 557
147 447
209 509
298 598
155 455
267 567
297 597
162 462
167 467
178 478
186 486
248 548
161 461
113 413
13 313
190 490
107 407
160 460
117 417
282 582
23 323
14 314
80 380
57 357
177 477
176 476
76 376
253 553
239 539
290 590
122 422
111 411
26...

output:

Meeting 2 - By moonrabbit2
My answer is: 419467694

result:

ok 2 lines

Test #67:

score: 30
Accepted
time: 206ms
memory: 9588kb

input:

300
367 503
47 301
228 398
182 466
152 417
273 538
119 226
126 222
125 362
72 294
33 530
385 508
4 214
154 512
116 263
365 598
188 269
163 351
129 536
50 316
180 559
69 422
303 531
333 554
54 248
392 585
371 543
78 481
348 580
339 568
143 558
353 557
218 366
297 465
186 379
242 520
86 221
160 424
26...

output:

Meeting 2 - By moonrabbit2
My answer is: 805103223

result:

ok 2 lines

Test #68:

score: 30
Accepted
time: 197ms
memory: 9392kb

input:

300
75 486
164 468
90 518
88 297
73 517
109 346
281 426
35 357
267 542
12 491
44 494
131 586
14 228
87 453
369 571
168 258
32 565
24 587
503 547
307 386
224 306
196 563
209 266
145 252
379 600
203 538
189 580
212 450
19 549
82 275
149 216
50 535
84 585
375 597
347 526
135 221
78 458
388 438
246 403
...

output:

Meeting 2 - By moonrabbit2
My answer is: 817021907

result:

ok 2 lines

Test #69:

score: 30
Accepted
time: 187ms
memory: 9620kb

input:

300
484 498
382 543
408 563
413 500
315 329
79 481
263 511
77 182
296 463
39 403
161 164
265 337
219 334
101 434
252 421
128 533
157 560
56 581
351 535
190 497
47 414
396 464
8 582
444 459
192 387
378 503
162 308
332 447
142 507
4 573
33 141
350 423
118 328
13 545
211 565
163 466
6 594
40 548
216 39...

output:

Meeting 2 - By moonrabbit2
My answer is: 554936157

result:

ok 2 lines

Test #70:

score: 30
Accepted
time: 185ms
memory: 9780kb

input:

300
19 293
378 522
249 583
347 578
278 426
285 525
238 549
359 595
126 345
102 418
275 546
34 156
283 558
185 427
243 471
29 350
289 356
353 463
59 485
64 181
266 314
65 259
572 600
128 225
221 467
364 519
118 440
323 469
77 591
256 551
192 586
279 355
239 453
48 99
51 273
140 543
83 318
47 535
242 ...

output:

Meeting 2 - By moonrabbit2
My answer is: 406180182

result:

ok 2 lines

Test #71:

score: 30
Accepted
time: 175ms
memory: 9676kb

input:

300
114 235
135 263
22 142
3 327
250 486
146 575
17 167
24 239
7 545
62 284
493 541
449 587
47 118
326 363
162 428
344 503
212 300
266 442
127 318
240 533
45 530
143 477
18 434
171 195
187 590
176 205
145 464
87 265
128 243
445 484
246 427
238 417
40 372
252 554
79 463
94 539
432 594
451 589
201 538...

output:

Meeting 2 - By moonrabbit2
My answer is: 24071508

result:

ok 2 lines

Test #72:

score: 30
Accepted
time: 167ms
memory: 9740kb

input:

300
121 382
163 364
374 443
179 209
254 276
206 446
372 461
257 437
41 583
410 436
132 226
152 283
268 326
15 501
68 223
288 385
84 280
169 310
99 458
456 525
537 571
49 418
82 349
87 224
454 519
189 201
327 355
291 412
396 430
308 323
4 590
386 493
243 362
457 562
140 578
25 391
86 361
8 596
175 18...

output:

Meeting 2 - By moonrabbit2
My answer is: 477914740

result:

ok 2 lines

Test #73:

score: 30
Accepted
time: 138ms
memory: 9784kb

input:

300
331 566
156 406
73 104
350 498
28 48
137 473
25 84
549 586
528 560
351 507
18 65
291 489
12 21
67 182
281 430
243 286
94 154
61 97
66 92
126 324
474 591
356 559
115 279
374 425
344 525
95 175
269 318
440 544
56 288
297 510
305 362
62 130
165 357
183 274
504 580
335 492
179 423
147 359
113 294
70...

output:

Meeting 2 - By moonrabbit2
My answer is: 265955524

result:

ok 2 lines

Test #74:

score: 30
Accepted
time: 133ms
memory: 9820kb

input:

300
279 339
103 107
276 304
66 109
468 599
179 326
2 3
563 572
217 528
489 584
382 440
426 581
322 577
233 583
44 181
55 388
330 432
172 190
135 167
143 153
401 481
258 492
513 533
261 370
52 163
76 144
75 250
152 340
14 300
360 446
386 394
451 557
38 50
421 482
237 274
275 313
266 430
277 327
568 5...

output:

Meeting 2 - By moonrabbit2
My answer is: 769311154

result:

ok 2 lines

Test #75:

score: 30
Accepted
time: 129ms
memory: 9884kb

input:

300
253 484
19 593
277 306
393 403
210 254
385 416
127 273
567 578
184 259
297 373
189 213
270 276
242 364
66 68
31 60
332 341
240 269
294 417
206 261
34 291
107 159
148 152
354 452
466 482
559 580
346 582
201 418
415 516
494 521
98 483
57 87
368 388
77 596
315 558
464 477
153 384
72 83
426 459
174 ...

output:

Meeting 2 - By moonrabbit2
My answer is: 106723120

result:

ok 2 lines

Test #76:

score: 30
Accepted
time: 6ms
memory: 8752kb

input:

300
414 423
227 246
253 258
330 349
303 319
536 575
364 378
307 323
517 555
16 51
296 327
232 261
149 162
131 152
406 434
122 151
456 482
474 493
235 266
174 187
188 210
394 429
126 160
233 263
133 157
550 589
467 495
539 594
515 598
81 104
228 248
350 379
200 213
241 264
123 153
510 573
403 431
537...

output:

Meeting 2 - By moonrabbit2
My answer is: 610395777

result:

ok 2 lines

Test #77:

score: 30
Accepted
time: 6ms
memory: 8768kb

input:

300
294 324
344 361
521 567
516 592
504 525
335 392
396 440
81 89
538 574
1 23
287 311
337 390
63 102
145 164
528 579
224 263
540 557
116 135
305 328
537 569
522 573
425 443
131 159
409 418
258 275
83 100
286 315
251 266
84 86
29 48
52 55
523 542
501 530
349 356
290 306
309 332
236 241
36 47
463 479...

output:

Meeting 2 - By moonrabbit2
My answer is: 112090793

result:

ok 2 lines

Test #78:

score: 30
Accepted
time: 0ms
memory: 8700kb

input:

300
126 151
121 152
338 382
172 188
85 92
110 164
62 101
173 193
240 251
451 496
169 221
182 209
238 269
478 494
357 375
24 55
233 268
168 224
456 469
28 57
253 259
242 243
176 215
241 264
356 360
22 27
579 587
65 83
73 94
137 154
70 104
510 539
406 417
175 207
481 492
350 371
26 46
468 486
535 590
...

output:

Meeting 2 - By moonrabbit2
My answer is: 63051938

result:

ok 2 lines

Test #79:

score: 30
Accepted
time: 0ms
memory: 8856kb

input:

300
88 109
197 201
385 421
337 354
332 348
32 56
329 340
157 169
289 317
177 185
527 566
559 572
350 369
330 359
140 166
60 82
573 591
1 4
71 84
85 101
146 168
118 155
446 448
278 307
11 52
86 90
259 264
15 41
208 218
305 318
469 481
285 319
389 416
113 131
75 96
10 12
487 534
570 598
498 533
124 13...

output:

Meeting 2 - By moonrabbit2
My answer is: 264951352

result:

ok 2 lines

Test #80:

score: 30
Accepted
time: 6ms
memory: 8884kb

input:

300
390 392
231 248
257 263
241 265
303 317
330 332
541 562
189 197
66 72
419 430
552 563
501 599
112 156
285 293
469 479
344 357
502 586
62 75
384 405
467 474
387 388
397 402
143 148
19 30
168 194
85 87
137 161
524 580
511 522
508 544
506 566
504 505
280 326
295 301
118 138
117 139
320 325
553 561
...

output:

Meeting 2 - By moonrabbit2
My answer is: 309060676

result:

ok 2 lines

Test #81:

score: 30
Accepted
time: 3ms
memory: 9284kb

input:

300
302 334
154 156
173 232
136 162
9 56
233 283
378 381
59 104
280 281
379 384
286 339
185 204
276 277
287 337
118 140
29 51
522 538
461 481
238 260
565 571
246 258
180 182
488 499
479 497
23 33
313 317
341 394
397 398
122 171
196 224
306 307
468 472
297 340
73 111
409 449
387 388
202 216
121 160
4...

output:

Meeting 2 - By moonrabbit2
My answer is: 329380500

result:

ok 2 lines

Test #82:

score: 30
Accepted
time: 3ms
memory: 9212kb

input:

300
223 257
383 385
180 195
554 583
153 161
299 313
459 471
496 519
280 290
271 293
134 136
567 599
507 542
151 152
392 404
561 570
283 305
488 501
350 374
212 215
82 83
460 474
157 163
25 43
219 240
201 208
19 46
238 253
164 176
91 100
408 429
301 318
360 377
269 270
289 297
317 323
170 192
435 449...

output:

Meeting 2 - By moonrabbit2
My answer is: 378631128

result:

ok 2 lines

Test #83:

score: 30
Accepted
time: 3ms
memory: 9252kb

input:

300
385 420
178 193
549 558
323 343
443 444
191 200
25 49
179 203
542 547
17 46
295 301
123 141
284 293
516 543
485 493
476 497
99 100
394 400
393 414
16 19
286 309
170 201
291 314
585 596
581 586
37 41
161 166
584 587
529 553
501 502
183 185
27 32
63 69
333 361
229 257
236 246
390 406
403 432
56 71...

output:

Meeting 2 - By moonrabbit2
My answer is: 185949209

result:

ok 2 lines

Test #84:

score: 30
Accepted
time: 3ms
memory: 8952kb

input:

300
194 201
291 296
408 417
521 531
348 356
297 320
285 288
146 153
293 321
305 316
77 85
545 596
282 283
70 80
10 12
504 507
212 219
38 42
270 272
20 50
497 499
237 266
64 95
233 242
351 353
331 333
58 108
27 52
402 418
230 231
330 369
249 252
69 79
62 91
14 40
461 489
87 98
294 295
243 246
151 155...

output:

Meeting 2 - By moonrabbit2
My answer is: 772920448

result:

ok 2 lines

Test #85:

score: 30
Accepted
time: 3ms
memory: 8408kb

input:

300
115 116
99 100
233 236
34 36
206 207
93 96
393 394
91 92
356 358
75 78
101 102
109 111
326 328
299 300
192 194
461 513
302 304
29 31
139 140
516 578
471 557
246 248
237 238
403 404
105 107
424 490
457 498
149 154
169 170
582 600
353 354
546 590
369 370
417 551
167 168
491 571
347 349
384 386
421...

output:

Meeting 2 - By moonrabbit2
My answer is: 435199433

result:

ok 2 lines

Test #86:

score: 30
Accepted
time: 13ms
memory: 8484kb

input:

300
445 592
537 591
207 210
413 584
354 356
147 149
528 569
351 355
352 353
163 164
277 278
503 515
172 173
170 174
211 212
446 461
205 209
465 511
139 140
199 200
339 340
65 68
295 298
61 62
308 309
401 502
324 326
396 559
398 447
3 7
31 36
233 235
70 71
39 40
98 102
269 273
448 581
249 250
175 176...

output:

Meeting 2 - By moonrabbit2
My answer is: 524297965

result:

ok 2 lines

Test #87:

score: 30
Accepted
time: 9ms
memory: 8588kb

input:

300
274 276
291 292
495 578
75 80
367 368
50 51
464 548
359 364
135 136
42 43
431 577
433 598
160 161
171 172
237 238
356 357
351 354
123 126
47 48
468 554
277 280
105 109
422 572
33 34
260 262
174 175
54 55
426 589
428 584
12 13
399 404
445 541
129 130
505 583
267 268
529 536
385 388
516 579
293 29...

output:

Meeting 2 - By moonrabbit2
My answer is: 274858419

result:

ok 2 lines

Test #88:

score: 30
Accepted
time: 8ms
memory: 8536kb

input:

300
182 184
432 560
313 314
63 64
421 504
331 332
169 170
217 219
60 62
81 84
436 518
389 448
394 494
456 517
383 415
453 487
252 256
203 206
209 210
506 571
425 491
75 76
211 214
171 175
185 186
259 260
361 362
455 530
529 575
55 57
172 174
245 246
109 110
380 525
549 593
463 499
289 290
341 342
29...

output:

Meeting 2 - By moonrabbit2
My answer is: 119001620

result:

ok 2 lines

Test #89:

score: 30
Accepted
time: 4ms
memory: 8488kb

input:

300
159 161
456 496
191 194
441 573
435 598
139 142
175 176
179 180
527 592
328 330
517 582
27 28
430 600
319 320
385 386
232 235
492 494
231 234
248 250
43 44
453 575
308 309
135 137
436 468
239 241
113 115
458 594
52 54
365 366
461 475
371 372
364 368
420 447
283 284
33 34
229 230
274 275
421 477
...

output:

Meeting 2 - By moonrabbit2
My answer is: 213046859

result:

ok 2 lines

Test #90:

score: 30
Accepted
time: 4ms
memory: 8400kb

input:

300
433 585
503 534
47 48
532 551
148 150
455 478
305 306
333 334
445 568
485 523
428 439
586 598
415 416
223 224
98 99
185 186
446 450
401 402
251 252
324 325
487 497
257 258
1 2
573 574
103 104
174 178
215 216
413 414
522 531
157 158
562 563
117 119
76 77
535 545
486 520
65 66
155 160
511 517
323 ...

output:

Meeting 2 - By moonrabbit2
My answer is: 528991849

result:

ok 2 lines

Test #91:

score: 30
Accepted
time: 11ms
memory: 8580kb

input:

300
472 525
7 8
507 551
151 152
559 598
43 44
432 483
11 12
546 590
109 110
32 34
438 593
293 294
141 142
361 362
405 499
285 286
501 542
387 404
433 547
209 214
457 514
237 239
111 112
99 100
523 538
353 354
302 303
175 178
335 337
14 15
181 182
183 184
591 599
341 342
47 48
469 535
494 527
317 318...

output:

Meeting 2 - By moonrabbit2
My answer is: 628959753

result:

ok 2 lines

Test #92:

score: 30
Accepted
time: 4ms
memory: 8416kb

input:

300
411 412
395 396
203 204
399 400
454 596
519 582
465 496
253 256
239 240
365 368
450 563
375 376
7 8
510 592
83 84
295 296
171 172
426 533
462 495
385 386
392 393
357 358
529 598
188 189
319 320
141 143
403 404
317 318
525 561
147 148
95 96
503 553
209 210
349 350
323 324
504 516
185 186
460 514
...

output:

Meeting 2 - By moonrabbit2
My answer is: 901812238

result:

ok 2 lines

Test #93:

score: 30
Accepted
time: 6ms
memory: 8492kb

input:

300
109 110
241 242
103 104
319 320
161 162
325 328
15 16
219 220
203 204
358 359
441 549
404 518
343 344
118 119
389 390
128 129
11 12
373 374
106 107
101 102
519 566
329 330
195 196
333 334
285 287
253 256
185 186
21 22
231 232
303 305
201 202
295 296
426 589
471 480
159 160
69 70
157 158
135 136
...

output:

Meeting 2 - By moonrabbit2
My answer is: 28488482

result:

ok 2 lines

Test #94:

score: 30
Accepted
time: 177ms
memory: 10016kb

input:

300
1 600
352 355
257 413
262 579
57 351
5 448
519 568
143 455
318 388
307 483
119 565
264 592
529 530
237 526
144 298
198 422
188 584
84 466
389 520
286 357
67 203
180 553
158 393
2 420
35 217
465 594
100 561
329 382
40 359
378 458
230 325
335 375
171 549
356 484
46 181
285 436
86 191
146 470
47 26...

output:

Meeting 2 - By moonrabbit2
My answer is: 875068373

result:

ok 2 lines

Test #95:

score: 30
Accepted
time: 74ms
memory: 7876kb

input:

222
184 432
162 329
83 270
169 331
9 89
137 213
321 382
70 334
208 384
187 404
151 373
366 369
219 234
390 433
85 271
231 380
260 307
47 252
131 178
145 367
166 312
72 341
139 302
16 296
289 339
265 385
308 310
81 377
140 399
34 170
67 115
127 398
241 421
134 411
298 311
189 376
292 375
52 244
146 4...

output:

Meeting 2 - By moonrabbit2
My answer is: 984707733

result:

ok 2 lines

Subtask #4:

score: 0
Time Limit Exceeded

Test #96:

score: 12
Accepted
time: 8ms
memory: 57276kb

input:

2000
2245 2246
2189 2190
1681 1682
1005 1006
1367 1368
2797 2798
2407 2408
1511 1512
1441 1442
3795 3796
1835 1836
1747 1748
2941 2942
3435 3436
2095 2096
1631 1632
2737 2738
1653 1654
2637 2638
3823 3824
3491 3492
15 16
325 326
2195 2196
3037 3038
3039 3040
1431 1432
3241 3242
715 716
2909 2910
119...

output:

Meeting 2 - By moonrabbit2
My answer is: 100292593

result:

ok 2 lines

Test #97:

score: 0
Time Limit Exceeded

input:

2000
3104 3105
2562 2563
2094 2095
2492 2493
3126 3127
2616 2617
464 465
1036 1037
3668 3669
3326 3327
324 325
1428 1429
3586 3587
3312 3313
1222 1223
720 721
3738 3739
2404 2405
3538 3539
2040 2041
1590 1591
3362 3363
3302 3303
3994 3995
804 805
1930 1931
3110 3111
2402 2403
2888 2889
1360 1361
378...

output:

Unauthorized output

result:


Subtask #5:

score: 0
Time Limit Exceeded

Test #120:

score: 0
Time Limit Exceeded

input:

1557
1352 1357
3085 3086
7 154
2861 2866
131 134
14 105
327 338
759 778
357 358
1863 1864
1968 1969
2795 2808
64 71
1299 1300
1215 1216
2048 2053
1750 1751
1957 1958
2598 2599
1817 1822
2699 2722
2583 2588
2005 2100
1334 1335
356 359
882 883
1707 1708
3001 3002
818 821
1102 1103
2968 2969
2788 2789
...

output:

Unauthorized output

result:


Subtask #6:

score: 0
Time Limit Exceeded

Test #143:

score: 0
Time Limit Exceeded

input:

1342
2401 2667
982 2071
494 1558
420 1442
91 681
1002 2088
1268 2277
971 2064
1092 2156
1980 2591
1081 2144
131 852
1011 2091
157 924
1551 2438
1940 2579
477 1530
1902 2569
1245 2261
448 1487
138 883
1511 2415
616 1712
492 1556
1225 2245
476 1529
1077 2140
804 1923
137 882
1387 2342
1222 2243
1824 2...

output:

Unauthorized output

result:


Subtask #7:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

0%