QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#127977#6677. Puzzle: Sashiganemoon_095WA 6ms7236kbC++171.4kb2023-07-20 13:29:462023-07-20 13:29:48

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-20 13:29:48]
  • 评测
  • 测评结果:WA
  • 用时:6ms
  • 内存:7236kb
  • [2023-07-20 13:29:46]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;
// #define endl '\n'
// #define int long long

long long M = 998244353;
typedef long long LL;
typedef pair<int, int> PII;

int n;

int m[1010][1010];

void solve() {
	cin >> n;
	int a, b;
	cin >> a >> b;
	if(n == 2) {
		if(a == b) {
			cout << 3 - a << ' ' << 3 - b << ' ' << 2 * a - 3 << ' ' << 2 * b - 3 << endl;


			return;
		}
	}

	cout << "Yes" << endl;

	cout << n - 1 << endl;
	int idx = 1;
	int aa = a - 1, bb = b + 1;
	while(aa > 0 && bb <= n) {
		cout << aa << ' ' << bb << ' ' << idx << ' ' << -1 * idx << endl;
		for(int i = 0; i <= idx; i++) {
			m[aa + i][bb] = 1;
			m[aa][bb - i]  = 1;
		}
		idx++;
		aa--;
		bb++;
	}
	aa = a + 1, bb = b - 1;

	while(aa <= n && bb > 0) {
		cout << aa << ' ' << bb << ' '<< -1 *idx << ' ' << idx << endl;
		for(int i = 0; i <= idx; i++) {
			m[aa - i][bb] = 1;
			m[aa][bb + i] = 1;
		}
		idx++;
		aa++;
		bb--;
	}
	if(!m[1][1]) {
		for(int i = 1; i <= n; i++) {
			if(i != a && !m[i][i] ) {
				cout << i << ' ' << i << ' ' << n - i << ' ' << n - i << endl;
			}
		}

	}
	else {
		for(int i = 1; i <= n; i++) {
			if(i != a && !m[i][i]) {
				cout << i << ' ' << i << ' ' << i - 1 << ' ' << i - 1 << endl;
			}
		}
	}



}

int main() {
	int t;
	// cin >> t;
	t = 1;
	while(t--) {
		//cout << "in\n";
		solve();}



}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3436kb

input:

5 3 4

output:

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

result:

ok Correct. (1 test case)

Test #2:

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

input:

1 1 1

output:

Yes
0

result:

ok Correct. (1 test case)

Test #3:

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

input:

3 2 3

output:

Yes
2
3 2 -1 1
1 1 2 2

result:

ok Correct. (1 test case)

Test #4:

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

input:

10 10 5

output:

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

result:

ok Correct. (1 test case)

Test #5:

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

input:

10 5 7

output:

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

result:

ok Correct. (1 test case)

Test #6:

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

input:

10 9 2

output:

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

result:

ok Correct. (1 test case)

Test #7:

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

input:

10 6 10

output:

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

result:

ok Correct. (1 test case)

Test #8:

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

input:

10 8 4

output:

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

result:

ok Correct. (1 test case)

Test #9:

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

input:

999 396 693

output:

Yes
998
395 694 1 -1
394 695 2 -2
393 696 3 -3
392 697 4 -4
391 698 5 -5
390 699 6 -6
389 700 7 -7
388 701 8 -8
387 702 9 -9
386 703 10 -10
385 704 11 -11
384 705 12 -12
383 706 13 -13
382 707 14 -14
381 708 15 -15
380 709 16 -16
379 710 17 -17
378 711 18 -18
377 712 19 -19
376 713 20 -20
375 714 21...

result:

ok Correct. (1 test case)

Test #10:

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

input:

999 963 827

output:

Yes
998
962 828 1 -1
961 829 2 -2
960 830 3 -3
959 831 4 -4
958 832 5 -5
957 833 6 -6
956 834 7 -7
955 835 8 -8
954 836 9 -9
953 837 10 -10
952 838 11 -11
951 839 12 -12
950 840 13 -13
949 841 14 -14
948 842 15 -15
947 843 16 -16
946 844 17 -17
945 845 18 -18
944 846 19 -19
943 847 20 -20
942 848 21...

result:

ok Correct. (1 test case)

Test #11:

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

input:

999 871 185

output:

Yes
998
870 186 1 -1
869 187 2 -2
868 188 3 -3
867 189 4 -4
866 190 5 -5
865 191 6 -6
864 192 7 -7
863 193 8 -8
862 194 9 -9
861 195 10 -10
860 196 11 -11
859 197 12 -12
858 198 13 -13
857 199 14 -14
856 200 15 -15
855 201 16 -16
854 202 17 -17
853 203 18 -18
852 204 19 -19
851 205 20 -20
850 206 21...

result:

ok Correct. (1 test case)

Test #12:

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

input:

999 787 812

output:

Yes
998
786 813 1 -1
785 814 2 -2
784 815 3 -3
783 816 4 -4
782 817 5 -5
781 818 6 -6
780 819 7 -7
779 820 8 -8
778 821 9 -9
777 822 10 -10
776 823 11 -11
775 824 12 -12
774 825 13 -13
773 826 14 -14
772 827 15 -15
771 828 16 -16
770 829 17 -17
769 830 18 -18
768 831 19 -19
767 832 20 -20
766 833 21...

result:

ok Correct. (1 test case)

Test #13:

score: -100
Wrong Answer
time: 0ms
memory: 6584kb

input:

999 396 199

output:

Yes
998
395 200 1 -1
394 201 2 -2
393 202 3 -3
392 203 4 -4
391 204 5 -5
390 205 6 -6
389 206 7 -7
388 207 8 -8
387 208 9 -9
386 209 10 -10
385 210 11 -11
384 211 12 -12
383 212 13 -13
382 213 14 -14
381 214 15 -15
380 215 16 -16
379 216 17 -17
378 217 18 -18
377 218 19 -19
376 219 20 -20
375 220 21...

result:

wrong answer L shape #594 out of bounds. (test case 1)