QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#544276#9177. String and Nailsgzchenben#RE 0ms1656kbC++14576b2024-09-02 14:26:172024-09-02 14:26:18

Judging History

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

  • [2024-09-02 14:26:18]
  • 评测
  • 测评结果:RE
  • 用时:0ms
  • 内存:1656kb
  • [2024-09-02 14:26:17]
  • 提交

answer

#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;

int n;
pair<int, int> pos[200005];
int main() {
    scanf("%d", &n);
    for (int i = 1;i <= n;i++) {
        scanf("%d%d", &pos[i].first, &pos[i].second);
    }
    sort(pos + 1, pos + n + 1, [](pair<int, int> x, pair<int, int> y) {
        return x.first * x.first + x.second + x.second > y.first * y.first + y.second * y.second;
        });

    printf("YES\n");

    for (int i = 1;i < n;i++) {
        printf("%d %d\n", pos[i].first, pos[i].second);
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
1 1
2 4
3 1

output:

YES
2 4
3 1

result:

ok Everything ok

Test #2:

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

input:

1
1000000000 0

output:

YES

result:

ok Everything ok

Test #3:

score: -100
Runtime Error

input:

200000
500000000 500000000
500244009 499720246
500488018 499440492
500732027 499160738
500976036 498880984
501220045 498601230
501464054 498321476
501708063 498041722
501952072 497761968
502196081 497482214
502440090 497202460
502684099 496922706
502928108 496642952
503172117 496363198
503416126 496...

output:


result: