結果
問題 | No.1944 ∞ |
ユーザー | skojiji |
提出日時 | 2022-05-21 00:30:27 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,196 bytes |
コンパイル時間 | 2,361 ms |
コンパイル使用メモリ | 207,000 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-20 10:46:44 |
合計ジャッジ時間 | 3,195 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 1 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | AC | 2 ms
5,376 KB |
testcase_05 | AC | 2 ms
5,376 KB |
testcase_06 | AC | 2 ms
5,376 KB |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | AC | 2 ms
5,376 KB |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | AC | 2 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 2 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | WA | - |
testcase_16 | AC | 6 ms
5,376 KB |
testcase_17 | AC | 3 ms
5,376 KB |
testcase_18 | AC | 4 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 4 ms
5,376 KB |
testcase_21 | AC | 5 ms
5,376 KB |
testcase_22 | AC | 3 ms
5,376 KB |
testcase_23 | AC | 2 ms
5,376 KB |
testcase_24 | AC | 3 ms
5,376 KB |
testcase_25 | AC | 5 ms
5,376 KB |
testcase_26 | AC | 5 ms
5,376 KB |
testcase_27 | AC | 4 ms
5,376 KB |
testcase_28 | AC | 3 ms
5,376 KB |
testcase_29 | AC | 3 ms
5,376 KB |
testcase_30 | AC | 4 ms
5,376 KB |
testcase_31 | AC | 4 ms
5,376 KB |
testcase_32 | AC | 4 ms
5,376 KB |
testcase_33 | AC | 31 ms
5,376 KB |
testcase_34 | AC | 30 ms
5,376 KB |
testcase_35 | AC | 31 ms
5,376 KB |
ソースコード
#include <bits/stdc++.h> #include <atcoder/mincostflow> #include <atcoder/modint> using namespace atcoder; using namespace std; #define REP(i, m, n) for (int64_t i = (int64_t)(m); i < (int64_t)(n); i++) #define rep(i, n) REP(i, 0, n) #define RREP(i, m, n) for (int64_t i = (int64_t)(m - 1); i >= (int64_t)(n); i--) #define rrep(i, n) RREP(i, n, 0) #define all(v) v.begin(), v.end() using vi = vector<int64_t>; using vvi = vector<vi>; using vb = vector<bool>; using vvb = vector<vb>; using vc = vector<char>; using vvc = vector<vc>; using vs = vector<string>; using vvs = vector<vs>; using vd = vector<long double>; using vvd = vector<vd>; using pii = pair<int64_t, int64_t>; using tii = tuple<int64_t, int64_t, int64_t>; using vp = vector<pii>; using vvp = vector<vp>; using vt = vector<tii>; using vvt = vector<vt>; using mint = modint; using vm = vector<mint>; using vvm = vector<vm>; using mii = map<int64_t, int64_t>; using pdi = pair<long double, int64_t>; using tdi = tuple<long double, int64_t, int64_t>; const int64_t INF = 2e18; const vp dxy = {{0, -1}, {-1, 0}, {0, 1}, {1, 0}}; template <typename T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } template <typename T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } int64_t to_int(char c) { return c - 'A'; } int64_t n, x, y; vi r; int64_t dist_sum; int64_t target_dist; int64_t dist_sum_without(int64_t i) { return dist_sum - 2 * r[i]; } bool check_inner(int64_t i) { int64_t d = dist_sum_without(i); if (target_dist >= r[i]) return (r[i] + d) * (r[i] + d) >= target_dist; else return (r[i] - d <= 0 || target_dist >= (r[i] - d) * (r[i] - d)); } bool check() { rep(i, n) { if (check_inner(i)) return true; } return false; } int main() { cin >> n >> x >> y; r.resize(n); rep(i, n) cin >> r[i]; dist_sum = 0; for (auto x : r) dist_sum += 2 * x; target_dist = x * x + y * y; if (n == 1) { if (r[0] * r[0] == target_dist) cout << "Yes" << endl; else cout << "No" << endl; return 0; } if (check()) cout << "Yes" << endl; else cout << "No" << endl; }