QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#208465#6677. Puzzle: SashiganePetroTarnavskyi#AC ✓1ms3936kbC++171.4kb2023-10-09 17:06:072023-10-09 17:06:08

Judging History

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

  • [2023-10-09 17:06:08]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3936kb
  • [2023-10-09 17:06:07]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(15);
	
	int n;
	cin >> n;
	int bx, by;
	cin >> bx >> by;
	bool sw = false;
	if (n - by < n - bx)
	{
		swap(bx, by);
		sw = true;
	}
	int c = n - bx + 1;
	int a = by - 1;
	int b = n - c - a;
	int x = bx + c - 1;
	int y = by + c - 1;
	int cp = c - 1;
	//cerr << c << ' ' << bx << ' ' << by << '\n';
	vector<VI> ans;
	while (cp)
	{
		ans.PB({x, y, -cp, -cp});
		cp--;
		x--;
		y--;
		//cerr << x << ' ' << y << '\n';
	}
	assert(x == bx && y == by);
	FOR (i, 0, a)
	{
		ans.PB({i + 1, i + 1, n - i - 1, n - i - 1});
	}
	x = a + 1;
	y = n;
	FOR (i, 0, b)
	{
		ans.PB({x + i, y - i, b + c - 1 - i, -(b + c - 1 - i)});
	}
	if (sw)
	{
		for (auto& v : ans)
		{
			swap(v[0], v[1]);
			swap(v[2], v[3]);
		}
	}
	cout << "Yes\n";
	cout << SZ(ans) << '\n';
	for (auto v : ans)
	{
		FOR (i, 0, 4)
		{
			if (i)
				cout << ' ';
			cout << v[i];
		}
		cout << '\n';
	}
	
	
	return 0;	
}



这程序好像有点Bug,我给组数据试试?

详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3640kb

input:

5 3 4

output:

Yes
4
4 5 -1 -1
1 1 4 4
2 2 3 3
5 3 -2 2

result:

ok Correct. (1 test case)

Test #2:

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

input:

1 1 1

output:

Yes
0

result:

ok Correct. (1 test case)

Test #3:

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

input:

3 2 3

output:

Yes
2
1 1 2 2
3 2 -1 1

result:

ok Correct. (1 test case)

Test #4:

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

input:

10 10 5

output:

Yes
9
1 1 9 9
2 2 8 8
3 3 7 7
4 4 6 6
5 10 5 -5
6 9 4 -4
7 8 3 -3
8 7 2 -2
9 6 1 -1

result:

ok Correct. (1 test case)

Test #5:

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

input:

10 5 7

output:

Yes
9
8 10 -3 -3
7 9 -2 -2
6 8 -1 -1
1 1 9 9
2 2 8 8
3 3 7 7
4 4 6 6
10 5 -5 5
9 6 -4 4

result:

ok Correct. (1 test case)

Test #6:

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

input:

10 9 2

output:

Yes
9
10 3 -1 -1
1 1 9 9
2 10 8 -8
3 9 7 -7
4 8 6 -6
5 7 5 -5
6 6 4 -4
7 5 3 -3
8 4 2 -2

result:

ok Correct. (1 test case)

Test #7:

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

input:

10 6 10

output:

Yes
9
1 1 9 9
2 2 8 8
3 3 7 7
4 4 6 6
5 5 5 5
10 6 -4 4
9 7 -3 3
8 8 -2 2
7 9 -1 1

result:

ok Correct. (1 test case)

Test #8:

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

input:

10 8 4

output:

Yes
9
10 6 -2 -2
9 5 -1 -1
1 1 9 9
2 2 8 8
3 3 7 7
4 10 6 -6
5 9 5 -5
6 8 4 -4
7 7 3 -3

result:

ok Correct. (1 test case)

Test #9:

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

input:

999 396 693

output:

Yes
998
702 999 -306 -306
701 998 -305 -305
700 997 -304 -304
699 996 -303 -303
698 995 -302 -302
697 994 -301 -301
696 993 -300 -300
695 992 -299 -299
694 991 -298 -298
693 990 -297 -297
692 989 -296 -296
691 988 -295 -295
690 987 -294 -294
689 986 -293 -293
688 985 -292 -292
687 984 -291 -291
686 ...

result:

ok Correct. (1 test case)

Test #10:

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

input:

999 963 827

output:

Yes
998
999 863 -36 -36
998 862 -35 -35
997 861 -34 -34
996 860 -33 -33
995 859 -32 -32
994 858 -31 -31
993 857 -30 -30
992 856 -29 -29
991 855 -28 -28
990 854 -27 -27
989 853 -26 -26
988 852 -25 -25
987 851 -24 -24
986 850 -23 -23
985 849 -22 -22
984 848 -21 -21
983 847 -20 -20
982 846 -19 -19
981 ...

result:

ok Correct. (1 test case)

Test #11:

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

input:

999 871 185

output:

Yes
998
999 313 -128 -128
998 312 -127 -127
997 311 -126 -126
996 310 -125 -125
995 309 -124 -124
994 308 -123 -123
993 307 -122 -122
992 306 -121 -121
991 305 -120 -120
990 304 -119 -119
989 303 -118 -118
988 302 -117 -117
987 301 -116 -116
986 300 -115 -115
985 299 -114 -114
984 298 -113 -113
983 ...

result:

ok Correct. (1 test case)

Test #12:

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

input:

999 787 812

output:

Yes
998
974 999 -187 -187
973 998 -186 -186
972 997 -185 -185
971 996 -184 -184
970 995 -183 -183
969 994 -182 -182
968 993 -181 -181
967 992 -180 -180
966 991 -179 -179
965 990 -178 -178
964 989 -177 -177
963 988 -176 -176
962 987 -175 -175
961 986 -174 -174
960 985 -173 -173
959 984 -172 -172
958 ...

result:

ok Correct. (1 test case)

Test #13:

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

input:

999 396 199

output:

Yes
998
999 802 -603 -603
998 801 -602 -602
997 800 -601 -601
996 799 -600 -600
995 798 -599 -599
994 797 -598 -598
993 796 -597 -597
992 795 -596 -596
991 794 -595 -595
990 793 -594 -594
989 792 -593 -593
988 791 -592 -592
987 790 -591 -591
986 789 -590 -590
985 788 -589 -589
984 787 -588 -588
983 ...

result:

ok Correct. (1 test case)

Test #14:

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

input:

999 1 1

output:

Yes
998
999 999 -998 -998
998 998 -997 -997
997 997 -996 -996
996 996 -995 -995
995 995 -994 -994
994 994 -993 -993
993 993 -992 -992
992 992 -991 -991
991 991 -990 -990
990 990 -989 -989
989 989 -988 -988
988 988 -987 -987
987 987 -986 -986
986 986 -985 -985
985 985 -984 -984
984 984 -983 -983
983 ...

result:

ok Correct. (1 test case)

Test #15:

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

input:

999 163 1

output:

Yes
998
999 837 -836 -836
998 836 -835 -835
997 835 -834 -834
996 834 -833 -833
995 833 -832 -832
994 832 -831 -831
993 831 -830 -830
992 830 -829 -829
991 829 -828 -828
990 828 -827 -827
989 827 -826 -826
988 826 -825 -825
987 825 -824 -824
986 824 -823 -823
985 823 -822 -822
984 822 -821 -821
983 ...

result:

ok Correct. (1 test case)

Test #16:

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

input:

999 999 1

output:

Yes
998
1 999 998 -998
2 998 997 -997
3 997 996 -996
4 996 995 -995
5 995 994 -994
6 994 993 -993
7 993 992 -992
8 992 991 -991
9 991 990 -990
10 990 989 -989
11 989 988 -988
12 988 987 -987
13 987 986 -986
14 986 985 -985
15 985 984 -984
16 984 983 -983
17 983 982 -982
18 982 981 -981
19 981 980 -9...

result:

ok Correct. (1 test case)

Test #17:

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

input:

999 1 969

output:

Yes
998
31 999 -30 -30
30 998 -29 -29
29 997 -28 -28
28 996 -27 -27
27 995 -26 -26
26 994 -25 -25
25 993 -24 -24
24 992 -23 -23
23 991 -22 -22
22 990 -21 -21
21 989 -20 -20
20 988 -19 -19
19 987 -18 -18
18 986 -17 -17
17 985 -16 -16
16 984 -15 -15
15 983 -14 -14
14 982 -13 -13
13 981 -12 -12
12 980 ...

result:

ok Correct. (1 test case)

Test #18:

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

input:

999 999 780

output:

Yes
998
1 1 998 998
2 2 997 997
3 3 996 996
4 4 995 995
5 5 994 994
6 6 993 993
7 7 992 992
8 8 991 991
9 9 990 990
10 10 989 989
11 11 988 988
12 12 987 987
13 13 986 986
14 14 985 985
15 15 984 984
16 16 983 983
17 17 982 982
18 18 981 981
19 19 980 980
20 20 979 979
21 21 978 978
22 22 977 977
23...

result:

ok Correct. (1 test case)

Test #19:

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

input:

999 1 999

output:

Yes
998
999 1 -998 998
998 2 -997 997
997 3 -996 996
996 4 -995 995
995 5 -994 994
994 6 -993 993
993 7 -992 992
992 8 -991 991
991 9 -990 990
990 10 -989 989
989 11 -988 988
988 12 -987 987
987 13 -986 986
986 14 -985 985
985 15 -984 984
984 16 -983 983
983 17 -982 982
982 18 -981 981
981 19 -980 9...

result:

ok Correct. (1 test case)

Test #20:

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

input:

999 686 999

output:

Yes
998
1 1 998 998
2 2 997 997
3 3 996 996
4 4 995 995
5 5 994 994
6 6 993 993
7 7 992 992
8 8 991 991
9 9 990 990
10 10 989 989
11 11 988 988
12 12 987 987
13 13 986 986
14 14 985 985
15 15 984 984
16 16 983 983
17 17 982 982
18 18 981 981
19 19 980 980
20 20 979 979
21 21 978 978
22 22 977 977
23...

result:

ok Correct. (1 test case)

Test #21:

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

input:

999 999 999

output:

Yes
998
1 1 998 998
2 2 997 997
3 3 996 996
4 4 995 995
5 5 994 994
6 6 993 993
7 7 992 992
8 8 991 991
9 9 990 990
10 10 989 989
11 11 988 988
12 12 987 987
13 13 986 986
14 14 985 985
15 15 984 984
16 16 983 983
17 17 982 982
18 18 981 981
19 19 980 980
20 20 979 979
21 21 978 978
22 22 977 977
23...

result:

ok Correct. (1 test case)

Test #22:

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

input:

1000 757 728

output:

Yes
999
1000 971 -243 -243
999 970 -242 -242
998 969 -241 -241
997 968 -240 -240
996 967 -239 -239
995 966 -238 -238
994 965 -237 -237
993 964 -236 -236
992 963 -235 -235
991 962 -234 -234
990 961 -233 -233
989 960 -232 -232
988 959 -231 -231
987 958 -230 -230
986 957 -229 -229
985 956 -228 -228
984...

result:

ok Correct. (1 test case)

Test #23:

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

input:

1000 132 993

output:

Yes
999
139 1000 -7 -7
138 999 -6 -6
137 998 -5 -5
136 997 -4 -4
135 996 -3 -3
134 995 -2 -2
133 994 -1 -1
1 1 999 999
2 2 998 998
3 3 997 997
4 4 996 996
5 5 995 995
6 6 994 994
7 7 993 993
8 8 992 992
9 9 991 991
10 10 990 990
11 11 989 989
12 12 988 988
13 13 987 987
14 14 986 986
15 15 985 985
1...

result:

ok Correct. (1 test case)

Test #24:

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

input:

1000 703 499

output:

Yes
999
1000 796 -297 -297
999 795 -296 -296
998 794 -295 -295
997 793 -294 -294
996 792 -293 -293
995 791 -292 -292
994 790 -291 -291
993 789 -290 -290
992 788 -289 -289
991 787 -288 -288
990 786 -287 -287
989 785 -286 -286
988 784 -285 -285
987 783 -284 -284
986 782 -283 -283
985 781 -282 -282
984...

result:

ok Correct. (1 test case)

Test #25:

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

input:

1000 910 298

output:

Yes
999
1000 388 -90 -90
999 387 -89 -89
998 386 -88 -88
997 385 -87 -87
996 384 -86 -86
995 383 -85 -85
994 382 -84 -84
993 381 -83 -83
992 380 -82 -82
991 379 -81 -81
990 378 -80 -80
989 377 -79 -79
988 376 -78 -78
987 375 -77 -77
986 374 -76 -76
985 373 -75 -75
984 372 -74 -74
983 371 -73 -73
982...

result:

ok Correct. (1 test case)

Test #26:

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

input:

1000 171 322

output:

Yes
999
849 1000 -678 -678
848 999 -677 -677
847 998 -676 -676
846 997 -675 -675
845 996 -674 -674
844 995 -673 -673
843 994 -672 -672
842 993 -671 -671
841 992 -670 -670
840 991 -669 -669
839 990 -668 -668
838 989 -667 -667
837 988 -666 -666
836 987 -665 -665
835 986 -664 -664
834 985 -663 -663
833...

result:

ok Correct. (1 test case)

Test #27:

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

input:

1000 1 1

output:

Yes
999
1000 1000 -999 -999
999 999 -998 -998
998 998 -997 -997
997 997 -996 -996
996 996 -995 -995
995 995 -994 -994
994 994 -993 -993
993 993 -992 -992
992 992 -991 -991
991 991 -990 -990
990 990 -989 -989
989 989 -988 -988
988 988 -987 -987
987 987 -986 -986
986 986 -985 -985
985 985 -984 -984
98...

result:

ok Correct. (1 test case)

Test #28:

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

input:

1000 480 1

output:

Yes
999
1000 521 -520 -520
999 520 -519 -519
998 519 -518 -518
997 518 -517 -517
996 517 -516 -516
995 516 -515 -515
994 515 -514 -514
993 514 -513 -513
992 513 -512 -512
991 512 -511 -511
990 511 -510 -510
989 510 -509 -509
988 509 -508 -508
987 508 -507 -507
986 507 -506 -506
985 506 -505 -505
984...

result:

ok Correct. (1 test case)

Test #29:

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

input:

1000 1000 1

output:

Yes
999
1 1000 999 -999
2 999 998 -998
3 998 997 -997
4 997 996 -996
5 996 995 -995
6 995 994 -994
7 994 993 -993
8 993 992 -992
9 992 991 -991
10 991 990 -990
11 990 989 -989
12 989 988 -988
13 988 987 -987
14 987 986 -986
15 986 985 -985
16 985 984 -984
17 984 983 -983
18 983 982 -982
19 982 981 -...

result:

ok Correct. (1 test case)

Test #30:

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

input:

1000 1 339

output:

Yes
999
662 1000 -661 -661
661 999 -660 -660
660 998 -659 -659
659 997 -658 -658
658 996 -657 -657
657 995 -656 -656
656 994 -655 -655
655 993 -654 -654
654 992 -653 -653
653 991 -652 -652
652 990 -651 -651
651 989 -650 -650
650 988 -649 -649
649 987 -648 -648
648 986 -647 -647
647 985 -646 -646
646...

result:

ok Correct. (1 test case)

Test #31:

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

input:

1000 1000 161

output:

Yes
999
1 1 999 999
2 2 998 998
3 3 997 997
4 4 996 996
5 5 995 995
6 6 994 994
7 7 993 993
8 8 992 992
9 9 991 991
10 10 990 990
11 11 989 989
12 12 988 988
13 13 987 987
14 14 986 986
15 15 985 985
16 16 984 984
17 17 983 983
18 18 982 982
19 19 981 981
20 20 980 980
21 21 979 979
22 22 978 978
23...

result:

ok Correct. (1 test case)

Test #32:

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

input:

1000 1 1000

output:

Yes
999
1000 1 -999 999
999 2 -998 998
998 3 -997 997
997 4 -996 996
996 5 -995 995
995 6 -994 994
994 7 -993 993
993 8 -992 992
992 9 -991 991
991 10 -990 990
990 11 -989 989
989 12 -988 988
988 13 -987 987
987 14 -986 986
986 15 -985 985
985 16 -984 984
984 17 -983 983
983 18 -982 982
982 19 -981 ...

result:

ok Correct. (1 test case)

Test #33:

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

input:

1000 759 1000

output:

Yes
999
1 1 999 999
2 2 998 998
3 3 997 997
4 4 996 996
5 5 995 995
6 6 994 994
7 7 993 993
8 8 992 992
9 9 991 991
10 10 990 990
11 11 989 989
12 12 988 988
13 13 987 987
14 14 986 986
15 15 985 985
16 16 984 984
17 17 983 983
18 18 982 982
19 19 981 981
20 20 980 980
21 21 979 979
22 22 978 978
23...

result:

ok Correct. (1 test case)

Test #34:

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

input:

1000 1000 1000

output:

Yes
999
1 1 999 999
2 2 998 998
3 3 997 997
4 4 996 996
5 5 995 995
6 6 994 994
7 7 993 993
8 8 992 992
9 9 991 991
10 10 990 990
11 11 989 989
12 12 988 988
13 13 987 987
14 14 986 986
15 15 985 985
16 16 984 984
17 17 983 983
18 18 982 982
19 19 981 981
20 20 980 980
21 21 979 979
22 22 978 978
23...

result:

ok Correct. (1 test case)

Test #35:

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

input:

2 1 1

output:

Yes
1
2 2 -1 -1

result:

ok Correct. (1 test case)

Test #36:

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

input:

2 1 2

output:

Yes
1
2 1 -1 1

result:

ok Correct. (1 test case)

Test #37:

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

input:

2 2 1

output:

Yes
1
1 2 1 -1

result:

ok Correct. (1 test case)

Test #38:

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

input:

2 2 2

output:

Yes
1
1 1 1 1

result:

ok Correct. (1 test case)

Test #39:

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

input:

810 114 514

output:

Yes
809
410 810 -296 -296
409 809 -295 -295
408 808 -294 -294
407 807 -293 -293
406 806 -292 -292
405 805 -291 -291
404 804 -290 -290
403 803 -289 -289
402 802 -288 -288
401 801 -287 -287
400 800 -286 -286
399 799 -285 -285
398 798 -284 -284
397 797 -283 -283
396 796 -282 -282
395 795 -281 -281
394 ...

result:

ok Correct. (1 test case)

Test #40:

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

input:

810 514 114

output:

Yes
809
810 410 -296 -296
809 409 -295 -295
808 408 -294 -294
807 407 -293 -293
806 406 -292 -292
805 405 -291 -291
804 404 -290 -290
803 403 -289 -289
802 402 -288 -288
801 401 -287 -287
800 400 -286 -286
799 399 -285 -285
798 398 -284 -284
797 397 -283 -283
796 396 -282 -282
795 395 -281 -281
794 ...

result:

ok Correct. (1 test case)