結果
問題 | No.3074 Divide Points Fairly |
ユーザー |
|
提出日時 | 2025-03-28 21:09:50 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 78 ms / 2,000 ms |
コード長 | 735 bytes |
コンパイル時間 | 5,624 ms |
コンパイル使用メモリ | 332,908 KB |
実行使用メモリ | 7,328 KB |
最終ジャッジ日時 | 2025-03-28 21:10:02 |
合計ジャッジ時間 | 10,508 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 42 |
ソースコード
#include <bits/stdc++.h> #include <atcoder/all> using namespace std; using namespace atcoder; using ll=long long; using mint=modint1000000007; int main() { int n; cin>>n; vector<pair<ll,ll>> xy(2*n); for(int i=0;i<2*n;i++)cin>>xy[i].first>>xy[i].second; random_device seed; mt19937 rnd(seed()); while(1){ ll a=(rnd()%200001)-100000,b=(rnd()%200001)-100000; sort(xy.begin(),xy.end(),[&](auto x,auto y)->bool{ return a*x.first+b*x.second<a*y.first+b*y.second; }); if(a*xy[n-1].first+b*xy[n-1].second+1<a*xy[n].first+b*xy[n].second){ cout<<a<<" "<<b<<" "<<-(a*xy[n-1].first+b*xy[n-1].second+1)<<endl; return 0; } } return 0; }