QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#185103#6677. Puzzle: Sashiganejeffqi#WA 0ms3704kbC++141.4kb2023-09-21 17:11:492023-09-21 17:11:50

Judging History

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

  • [2023-09-21 17:11:50]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3704kb
  • [2023-09-21 17:11:49]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define eb emplace_back
#define pb push_back
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(v) ((int)v.size())
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define se second
#define umap unordered_map
#define uset unordered_set
#define mset multiset
#define ui unsigned int
#define ull unsigned ll
#define i128 __int128
using namespace std;

namespace qiqi {
	void main() {
		int n,x0,y0,x1,y1;
		cin >> n >> x0 >> y0;
		x1 = x0; y1 = y0;
		cout << "Yes\n" << n-1 << '\n';
		for (int i = 1; i < n; i++) {
			if (x0 > 1 && y0 > 1) {
				x0--; y0--;
				cout << x0 << ' ' << y0 << ' ' << i << ' ' << i << '\n';
			}
			else if (x0 > 1 && y1 < n) {
				x0--; y1++;
				cout << x0 << ' ' << y0 << ' ' << i << ' ' << -i << '\n';
			}
			else if (x1 < n && y0 > 1) {
				x1++; y0--;
				cout << x1 << ' ' << y0 << ' ' << -i << ' ' << i << '\n';
			}
			else {
				x1++; y1++;
				cout << x1 << ' ' << y1 << ' ' << -i << ' ' << -i << '\n';
			}
		}
	}
}

int main() {
//	clock_t st = clock();
//	freopen("test.in","r",stdin);
//	freopen("test.out","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int T = 1;
//	cin >> T;
	while (T--) {
		qiqi::main();
	}

//	cout << (double)(clock()-st)/CLOCKS_PER_SEC;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

5 3 4

output:

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

result:

ok Correct. (1 test case)

Test #2:

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

input:

1 1 1

output:

Yes
0

result:

ok Correct. (1 test case)

Test #3:

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

input:

3 2 3

output:

Yes
2
1 2 1 1
3 1 -2 2

result:

ok Correct. (1 test case)

Test #4:

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

input:

10 10 5

output:

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

result:

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