QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#664657 | #692. Delete the Points | zla | WA | 0ms | 3648kb | C++14 | 1.4kb | 2024-10-21 21:35:55 | 2024-10-21 21:35:57 |
Judging History
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 = 1;
// cin >> T;
while (T -- ) zla::main();
return 0;
}
/*
1
4
1 1
2 2
5 5
6 6
*/
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3640kb
input:
4 1 1 2 2 5 5 6 6
output:
Yes 5 5 6 6 1 1 2 2
result:
ok OK
Test #2:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
4 0 0 1 2 2 1 4 4
output:
Yes 2 1 5 4 0 0 2 2
result:
ok OK
Test #3:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
4 1 2 3 2 2 1 2 3
output:
Yes 2 2 3 3 1 1 2 2
result:
ok OK
Test #4:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
6 12 9 1 5 10 14 20 14 15 4 7 9
output:
Yes 15 4 25 14 10 9 15 14 1 5 7 11
result:
ok OK
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3540kb
input:
10 39 72 59 52 23 17 2 31 30 0 25 88 2 36 61 23 4 96 59 76
output:
Yes 59 23 112 76 39 52 59 72 25 0 113 88 4 17 83 96 2 36 7 41
result:
wrong answer We have 3 point(s) in query 0