QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#127967#6677. Puzzle: Sashiganemoon_095WA 1ms3500kbC++171.2kb2023-07-20 13:22:092023-07-20 13:22:11

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:22:11]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3500kb
  • [2023-07-20 13:22:09]
  • 提交

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;
	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) {
				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: 3432kb

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: 3324kb

input:

1 1 1

output:

Yes
0

result:

ok Correct. (1 test case)

Test #3:

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

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: 3444kb

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: 3436kb

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: -100
Wrong Answer
time: 1ms
memory: 3500kb

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
1 1 0 0
2 2 1 1
3 3 2 2
4 4 3 3
5 5 4 4
6 6 5 5
7 7 6 6
8 8 7 7
10 10 9 9

result:

wrong output format Expected EOF (test case 1)