結果

問題 No.761 平均値ゲーム
ユーザー sugim48sugim48
提出日時 2018-12-19 01:06:12
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 701 bytes
コンパイル時間 1,998 ms
コンパイル使用メモリ 204,432 KB
実行使用メモリ 4,956 KB
最終ジャッジ日時 2023-10-25 23:47:24
合計ジャッジ時間 7,324 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 2 ms
4,348 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 WA -
testcase_25 AC 2 ms
4,348 KB
testcase_26 WA -
testcase_27 AC 2 ms
4,348 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
4,348 KB
testcase_31 WA -
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 38 ms
4,428 KB
testcase_34 WA -
testcase_35 AC 6 ms
4,348 KB
testcase_36 AC 25 ms
4,348 KB
testcase_37 AC 35 ms
4,428 KB
testcase_38 AC 36 ms
4,428 KB
testcase_39 AC 45 ms
4,692 KB
testcase_40 WA -
testcase_41 WA -
testcase_42 AC 46 ms
4,692 KB
testcase_43 AC 10 ms
4,348 KB
testcase_44 AC 29 ms
4,348 KB
testcase_45 AC 40 ms
4,692 KB
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 AC 45 ms
4,692 KB
testcase_50 AC 7 ms
4,348 KB
testcase_51 WA -
testcase_52 AC 5 ms
4,348 KB
testcase_53 AC 46 ms
4,692 KB
testcase_54 WA -
testcase_55 AC 47 ms
4,692 KB
testcase_56 WA -
testcase_57 AC 47 ms
4,692 KB
testcase_58 WA -
testcase_59 AC 43 ms
4,692 KB
testcase_60 AC 15 ms
4,348 KB
testcase_61 WA -
testcase_62 AC 47 ms
4,692 KB
testcase_63 WA -
testcase_64 AC 42 ms
4,692 KB
testcase_65 WA -
testcase_66 AC 10 ms
4,348 KB
testcase_67 WA -
testcase_68 AC 7 ms
4,348 KB
testcase_69 AC 37 ms
4,428 KB
testcase_70 AC 25 ms
4,348 KB
testcase_71 WA -
testcase_72 AC 7 ms
4,348 KB
testcase_73 WA -
testcase_74 AC 11 ms
4,348 KB
testcase_75 WA -
testcase_76 AC 14 ms
4,348 KB
testcase_77 AC 37 ms
4,428 KB
testcase_78 WA -
testcase_79 WA -
testcase_80 WA -
testcase_81 AC 8 ms
4,348 KB
testcase_82 WA -
testcase_83 WA -
testcase_84 WA -
testcase_85 WA -
testcase_86 WA -
testcase_87 WA -
testcase_88 WA -
testcase_89 WA -
testcase_90 WA -
testcase_91 WA -
testcase_92 WA -
testcase_93 WA -
testcase_94 WA -
testcase_95 AC 46 ms
4,956 KB
testcase_96 AC 52 ms
4,956 KB
testcase_97 AC 50 ms
4,956 KB
testcase_98 WA -
testcase_99 AC 51 ms
4,956 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define rep(i, N) for (int i = 0; i < (N); i++)
#define all(a) (a).begin(), (a).end()
#define pb push_back

using ll = long long;
using i_i = tuple<int, int>;

bool f(int l, int r, vector<ll>& a, vector<ll>& sum) {
    int m = lower_bound(a.begin() + l, a.begin() + r, sum[r] - sum[l]) - a.begin();
    if (m < r && !f(l, m, a, sum)) return true;
    if (l < m && !f(m, r, a, sum)) return true;
    return false;
}

int main() {
    int N; cin >> N;
    vector<ll> a(N);
    rep(i, N) cin >> a[i];
    vector<ll> sum(N + 1);
    rep(i, N) sum[i + 1] = sum[i] + a[i];
    rep(i, N) a[i] *= N;
    cout << (f(0, N, a, sum) ? "First" : "Second") << endl;
}
0