結果

問題 No.3074 Divide Points Fairly
ユーザー cho435
提出日時 2025-03-28 23:51:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,153 bytes
コンパイル時間 4,496 ms
コンパイル使用メモリ 255,324 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-28 23:51:29
合計ジャッジ時間 10,796 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 17 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, s, t) for (ll i = s; i < (ll)(t); i++)
#define all(x) begin(x), end(x)

template <typename T> bool chmin(T &x, T y) {
	return x > y ? (x = y, true) : false;
}
template <typename T> bool chmax(T &x, T y) {
	return x < y ? (x = y, true) : false;
}

struct IOST {
	IOST() {
		ios::sync_with_stdio(false);
		cin.tie(nullptr);
		cout << fixed << setprecision(20);
	}
} IOST;

unsigned int randxor(){
	static unsigned int x=123456789,y=362436069,z=521288629,w=88675123;
	unsigned int t=(x^(x<<11)); x=y;y=z;z=w;
	return(w=(w^(w>>19))^(t^(t>>8)));
}

int main(){
	int n;
	cin>>n;
	vector<ll> x(n*2),y(n*2);
	rep(i,0,n*2) cin>>x[i]>>y[i];
	const int MAX_AB=1e5;
	const int MIN_AB=-1e5;
	const ll MAX_C=2e10;
	const ll MIN_C=-2e10;
	while(1){
		ll a=(int)(randxor()%(MAX_AB-MIN_AB+1))+MIN_AB;
		ll b=(int)(randxor()%(MAX_AB-MIN_AB+1))+MIN_AB;
		vector<ll> tmp;
		rep(i,0,n*2){
			tmp.push_back(a*x[i]+b*y[i]);
		}
		sort(tmp.begin(),tmp.end());
		ll c=tmp[n-1]+1;
		if(c<tmp[n]&&MIN_C<=c&&c<=MAX_C){
			cout<<a<<" "<<b<<" "<<c<<"\n";
			return 0;
		}
	}
}
0