QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#707363#9177. String and NailstamirWA 80ms8368kbC++14587b2024-11-03 15:39:582024-11-03 15:39:59

Judging History

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

  • [2024-11-03 15:39:59]
  • 评测
  • 测评结果:WA
  • 用时:80ms
  • 内存:8368kb
  • [2024-11-03 15:39:58]
  • 提交

answer

#include<bits/stdc++.h>
#define ll long long
#define ff first
#define ss second
using namespace std;
ll n,i;
pair<ll,ll> p[200005];
vector<ll> v;
bool cmp(ll a,ll b){
	return ((p[a].ff-p[1].ff)*(p[b].ss-p[1].ss)<(p[b].ff-p[1].ff)*(p[a].ss-p[1].ss));
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	cin >> n;
	for(i=1;i<=n;i++) cin >> p[i].ff >> p[i].ss;
	sort(p+1,p+n+1);
	for(i=2;i<=n;i++){
		v.push_back(i);
	}
	sort(v.begin(),v.end(),cmp);
	cout << "YES\n";
	for(i=0;i<v.size();i++){
		cout << p[v[i]].ff << " " << p[v[i]].ss << "\n";
	}
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

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

input:

1
1000000000 0

output:

YES

result:

ok Everything ok

Test #3:

score: -100
Wrong Answer
time: 80ms
memory: 8368kb

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:

YES
776676706 741324901
620294220 604923870
711494024 684470804
711773778 684714813
538046544 533185224
582527430 571982655
776956460 741568910
712053532 684958822
641835278 623712563
582247676 571738646
712333286 685202831
712613040 685446840
582807184 572226664
538326298 533429233
581967922 571494...

result:

wrong answer Wrong answer