QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#90501#5255. Greedy Drawersysghwzp#AC ✓9ms3500kbC++17552b2023-03-23 13:26:022023-03-23 13:26:06

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-03-23 13:26:06]
  • Judged
  • Verdict: AC
  • Time: 9ms
  • Memory: 3500kb
  • [2023-03-23 13:26:02]
  • Submitted

answer

#include <bits/stdc++.h>
typedef long long ll;
#define For(i,l,r) for(int i=(int)(l);i<=(int)(r);i++)
#define pb push_back
using namespace std;
const int N=1000005,inf=500;
int x[N],y[N],n,m;
int main(){
	cin>>n;
	m=n/4*4;
	for(int i=1;i<=m;i+=4){
		for(int j=i;j<=i+2;j++){
			x[j]=i+3; y[j]=n-i+1;
		}
		x[i+3]=i+4; y[i+3]=n-i-2;
	}
	x[m]=x[m-1]; y[m]=y[m-1];
	for(int i=m+1;i<=n;i++){
		x[i]=i; y[i]=n-i+1;
	}
	For(i,1,n){
		cout<<i<<" "<<n-i+1+inf<<endl;
	}
	puts("");
	For(i,1,n){
		cout<<x[i]<<" "<<y[i]+inf<<endl;
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3500kb

input:

150

output:

1 650
2 649
3 648
4 647
5 646
6 645
7 644
8 643
9 642
10 641
11 640
12 639
13 638
14 637
15 636
16 635
17 634
18 633
19 632
20 631
21 630
22 629
23 628
24 627
25 626
26 625
27 624
28 623
29 622
30 621
31 620
32 619
33 618
34 617
35 616
36 615
37 614
38 613
39 612
40 611
41 610
42 609
43 608
44 607
4...

result:

ok you killed Janko's strategy

Test #2:

score: 0
Accepted
time: 1ms
memory: 3328kb

input:

151

output:

1 651
2 650
3 649
4 648
5 647
6 646
7 645
8 644
9 643
10 642
11 641
12 640
13 639
14 638
15 637
16 636
17 635
18 634
19 633
20 632
21 631
22 630
23 629
24 628
25 627
26 626
27 625
28 624
29 623
30 622
31 621
32 620
33 619
34 618
35 617
36 616
37 615
38 614
39 613
40 612
41 611
42 610
43 609
44 608
4...

result:

ok you killed Janko's strategy

Test #3:

score: 0
Accepted
time: 5ms
memory: 3308kb

input:

152

output:

1 652
2 651
3 650
4 649
5 648
6 647
7 646
8 645
9 644
10 643
11 642
12 641
13 640
14 639
15 638
16 637
17 636
18 635
19 634
20 633
21 632
22 631
23 630
24 629
25 628
26 627
27 626
28 625
29 624
30 623
31 622
32 621
33 620
34 619
35 618
36 617
37 616
38 615
39 614
40 613
41 612
42 611
43 610
44 609
4...

result:

ok you killed Janko's strategy

Test #4:

score: 0
Accepted
time: 4ms
memory: 3308kb

input:

153

output:

1 653
2 652
3 651
4 650
5 649
6 648
7 647
8 646
9 645
10 644
11 643
12 642
13 641
14 640
15 639
16 638
17 637
18 636
19 635
20 634
21 633
22 632
23 631
24 630
25 629
26 628
27 627
28 626
29 625
30 624
31 623
32 622
33 621
34 620
35 619
36 618
37 617
38 616
39 615
40 614
41 613
42 612
43 611
44 610
4...

result:

ok you killed Janko's strategy

Test #5:

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

input:

154

output:

1 654
2 653
3 652
4 651
5 650
6 649
7 648
8 647
9 646
10 645
11 644
12 643
13 642
14 641
15 640
16 639
17 638
18 637
19 636
20 635
21 634
22 633
23 632
24 631
25 630
26 629
27 628
28 627
29 626
30 625
31 624
32 623
33 622
34 621
35 620
36 619
37 618
38 617
39 616
40 615
41 614
42 613
43 612
44 611
4...

result:

ok you killed Janko's strategy

Test #6:

score: 0
Accepted
time: 9ms
memory: 3328kb

input:

155

output:

1 655
2 654
3 653
4 652
5 651
6 650
7 649
8 648
9 647
10 646
11 645
12 644
13 643
14 642
15 641
16 640
17 639
18 638
19 637
20 636
21 635
22 634
23 633
24 632
25 631
26 630
27 629
28 628
29 627
30 626
31 625
32 624
33 623
34 622
35 621
36 620
37 619
38 618
39 617
40 616
41 615
42 614
43 613
44 612
4...

result:

ok you killed Janko's strategy

Test #7:

score: 0
Accepted
time: 6ms
memory: 3348kb

input:

156

output:

1 656
2 655
3 654
4 653
5 652
6 651
7 650
8 649
9 648
10 647
11 646
12 645
13 644
14 643
15 642
16 641
17 640
18 639
19 638
20 637
21 636
22 635
23 634
24 633
25 632
26 631
27 630
28 629
29 628
30 627
31 626
32 625
33 624
34 623
35 622
36 621
37 620
38 619
39 618
40 617
41 616
42 615
43 614
44 613
4...

result:

ok you killed Janko's strategy

Test #8:

score: 0
Accepted
time: 7ms
memory: 3336kb

input:

157

output:

1 657
2 656
3 655
4 654
5 653
6 652
7 651
8 650
9 649
10 648
11 647
12 646
13 645
14 644
15 643
16 642
17 641
18 640
19 639
20 638
21 637
22 636
23 635
24 634
25 633
26 632
27 631
28 630
29 629
30 628
31 627
32 626
33 625
34 624
35 623
36 622
37 621
38 620
39 619
40 618
41 617
42 616
43 615
44 614
4...

result:

ok you killed Janko's strategy

Test #9:

score: 0
Accepted
time: 5ms
memory: 3424kb

input:

158

output:

1 658
2 657
3 656
4 655
5 654
6 653
7 652
8 651
9 650
10 649
11 648
12 647
13 646
14 645
15 644
16 643
17 642
18 641
19 640
20 639
21 638
22 637
23 636
24 635
25 634
26 633
27 632
28 631
29 630
30 629
31 628
32 627
33 626
34 625
35 624
36 623
37 622
38 621
39 620
40 619
41 618
42 617
43 616
44 615
4...

result:

ok you killed Janko's strategy

Test #10:

score: 0
Accepted
time: 2ms
memory: 3364kb

input:

159

output:

1 659
2 658
3 657
4 656
5 655
6 654
7 653
8 652
9 651
10 650
11 649
12 648
13 647
14 646
15 645
16 644
17 643
18 642
19 641
20 640
21 639
22 638
23 637
24 636
25 635
26 634
27 633
28 632
29 631
30 630
31 629
32 628
33 627
34 626
35 625
36 624
37 623
38 622
39 621
40 620
41 619
42 618
43 617
44 616
4...

result:

ok you killed Janko's strategy

Test #11:

score: 0
Accepted
time: 9ms
memory: 3476kb

input:

160

output:

1 660
2 659
3 658
4 657
5 656
6 655
7 654
8 653
9 652
10 651
11 650
12 649
13 648
14 647
15 646
16 645
17 644
18 643
19 642
20 641
21 640
22 639
23 638
24 637
25 636
26 635
27 634
28 633
29 632
30 631
31 630
32 629
33 628
34 627
35 626
36 625
37 624
38 623
39 622
40 621
41 620
42 619
43 618
44 617
4...

result:

ok you killed Janko's strategy

Test #12:

score: 0
Accepted
time: 4ms
memory: 3332kb

input:

161

output:

1 661
2 660
3 659
4 658
5 657
6 656
7 655
8 654
9 653
10 652
11 651
12 650
13 649
14 648
15 647
16 646
17 645
18 644
19 643
20 642
21 641
22 640
23 639
24 638
25 637
26 636
27 635
28 634
29 633
30 632
31 631
32 630
33 629
34 628
35 627
36 626
37 625
38 624
39 623
40 622
41 621
42 620
43 619
44 618
4...

result:

ok you killed Janko's strategy

Test #13:

score: 0
Accepted
time: 0ms
memory: 3328kb

input:

162

output:

1 662
2 661
3 660
4 659
5 658
6 657
7 656
8 655
9 654
10 653
11 652
12 651
13 650
14 649
15 648
16 647
17 646
18 645
19 644
20 643
21 642
22 641
23 640
24 639
25 638
26 637
27 636
28 635
29 634
30 633
31 632
32 631
33 630
34 629
35 628
36 627
37 626
38 625
39 624
40 623
41 622
42 621
43 620
44 619
4...

result:

ok you killed Janko's strategy

Test #14:

score: 0
Accepted
time: 0ms
memory: 3316kb

input:

163

output:

1 663
2 662
3 661
4 660
5 659
6 658
7 657
8 656
9 655
10 654
11 653
12 652
13 651
14 650
15 649
16 648
17 647
18 646
19 645
20 644
21 643
22 642
23 641
24 640
25 639
26 638
27 637
28 636
29 635
30 634
31 633
32 632
33 631
34 630
35 629
36 628
37 627
38 626
39 625
40 624
41 623
42 622
43 621
44 620
4...

result:

ok you killed Janko's strategy

Test #15:

score: 0
Accepted
time: 0ms
memory: 3368kb

input:

164

output:

1 664
2 663
3 662
4 661
5 660
6 659
7 658
8 657
9 656
10 655
11 654
12 653
13 652
14 651
15 650
16 649
17 648
18 647
19 646
20 645
21 644
22 643
23 642
24 641
25 640
26 639
27 638
28 637
29 636
30 635
31 634
32 633
33 632
34 631
35 630
36 629
37 628
38 627
39 626
40 625
41 624
42 623
43 622
44 621
4...

result:

ok you killed Janko's strategy

Test #16:

score: 0
Accepted
time: 7ms
memory: 3356kb

input:

165

output:

1 665
2 664
3 663
4 662
5 661
6 660
7 659
8 658
9 657
10 656
11 655
12 654
13 653
14 652
15 651
16 650
17 649
18 648
19 647
20 646
21 645
22 644
23 643
24 642
25 641
26 640
27 639
28 638
29 637
30 636
31 635
32 634
33 633
34 632
35 631
36 630
37 629
38 628
39 627
40 626
41 625
42 624
43 623
44 622
4...

result:

ok you killed Janko's strategy

Test #17:

score: 0
Accepted
time: 0ms
memory: 3308kb

input:

166

output:

1 666
2 665
3 664
4 663
5 662
6 661
7 660
8 659
9 658
10 657
11 656
12 655
13 654
14 653
15 652
16 651
17 650
18 649
19 648
20 647
21 646
22 645
23 644
24 643
25 642
26 641
27 640
28 639
29 638
30 637
31 636
32 635
33 634
34 633
35 632
36 631
37 630
38 629
39 628
40 627
41 626
42 625
43 624
44 623
4...

result:

ok you killed Janko's strategy

Test #18:

score: 0
Accepted
time: 1ms
memory: 3332kb

input:

167

output:

1 667
2 666
3 665
4 664
5 663
6 662
7 661
8 660
9 659
10 658
11 657
12 656
13 655
14 654
15 653
16 652
17 651
18 650
19 649
20 648
21 647
22 646
23 645
24 644
25 643
26 642
27 641
28 640
29 639
30 638
31 637
32 636
33 635
34 634
35 633
36 632
37 631
38 630
39 629
40 628
41 627
42 626
43 625
44 624
4...

result:

ok you killed Janko's strategy

Test #19:

score: 0
Accepted
time: 2ms
memory: 3320kb

input:

168

output:

1 668
2 667
3 666
4 665
5 664
6 663
7 662
8 661
9 660
10 659
11 658
12 657
13 656
14 655
15 654
16 653
17 652
18 651
19 650
20 649
21 648
22 647
23 646
24 645
25 644
26 643
27 642
28 641
29 640
30 639
31 638
32 637
33 636
34 635
35 634
36 633
37 632
38 631
39 630
40 629
41 628
42 627
43 626
44 625
4...

result:

ok you killed Janko's strategy

Test #20:

score: 0
Accepted
time: 5ms
memory: 3332kb

input:

250

output:

1 750
2 749
3 748
4 747
5 746
6 745
7 744
8 743
9 742
10 741
11 740
12 739
13 738
14 737
15 736
16 735
17 734
18 733
19 732
20 731
21 730
22 729
23 728
24 727
25 726
26 725
27 724
28 723
29 722
30 721
31 720
32 719
33 718
34 717
35 716
36 715
37 714
38 713
39 712
40 711
41 710
42 709
43 708
44 707
4...

result:

ok you killed Janko's strategy