結果
問題 |
No.3074 Divide Points Fairly
|
ユーザー |
|
提出日時 | 2025-03-28 22:01:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 749 bytes |
コンパイル時間 | 1,778 ms |
コンパイル使用メモリ | 196,008 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-28 22:01:25 |
合計ジャッジ時間 | 6,148 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 WA * 6 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (int)(n); i++) void solve() { ll n; cin >> n; vector<ll> x(n * 2), y(n * 2); rep(i, n * 2) cin >> x[i] >> y[i]; const ll a = 100'000; auto check = [&](const ll c) -> bool { ll res = 0; rep(i, n * 2) if (y[i] > -a * x[i] - c) res++; return res >= n; }; ll ng = -ll(2e10) - 1, ok = ll(2e10); while (ng + 1 < ok) { ll c = (ng + ok) / 2; if (check(c)) { ok = c; } else { ng = c; } } cout << a << ' ' << 1 << ' ' << ok << '\n'; } int main() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); int T = 1; for (int t = 0; t < T; t++) { solve(); } return 0; }