QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#664636#692. Delete the PointszlaWA 0ms3708kbC++141.4kb2024-10-21 21:32:272024-10-21 21:32:28

Judging History

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

  • [2024-10-21 21:32:28]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3708kb
  • [2024-10-21 21:32:27]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
using namespace std;

#define IOS ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
#define fre(x) freopen(x".in", "r", stdin); freopen(x".out", "w", stdout);
#define debin(x) freopen(x".in", "r", stdin);
#define debout(x) freopen(x".ans", "w", stdout);

const int N = 3010;

namespace zla {
#define x1 dfhsfislu
#define y1 asdfuadch
#define x2 asdfcakcf
#define y2 dsakkaksf
	int n;
	struct node {
		int x, y;
		bool operator < (const node &other) const {
			if (x != other.x) return x < other.x;
			return y < other.y;
		}
	} a[N];
	
	void Clear() {
		;
	}
	
	void Init() {
		cin >> n;
		for (int i = 1; i <= n; i ++ ) cin >> a[i].x >> a[i].y;
	}
	
	void Solve() {
		cout << "Yes\n";
		sort (a + 1, a + n + 1);
		for (int i = n; i >= 1; i -= 2) {
			int x1 = a[i].x, y1 = a[i].y, x2 = a[i - 1].x, y2 = a[i - 1].y;
			int t = max(abs(x1 - x2), abs(y1 - y2));
			if (x1 > x2 && y1 > y2) cout << x2 << " " << y2 << " " << x2 + t << " " << y2 + t << "\n";
			else {
				int x = x2, y = y1;
				cout << x << " " << y << " " << x + t << " " << y + t << "\n";
			}
		}
	}
	
	void main() {
		Clear();
		Init();
		Solve();
	}
}

signed main() {
	IOS;
	// fre("stone");
	// debin("stone3");
	// debout("stone3");
	int T;
	cin >> T;
	while (T -- ) zla::main();
	return 0;
}
/*
1
4
1 1
2 2
5 5
6 6

*/

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3708kb

input:

4
1 1
2 2
5 5
6 6

output:

Yes
0 0 2 2
Yes
5 5 6 6
Yes
5 5 6 6
Yes
5 5 6 6

result:

wrong answer Expected double but found NAN.