結果

問題 No.761 平均値ゲーム
ユーザー omochanalomochanal
提出日時 2018-12-20 19:22:57
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 2,318 bytes
コンパイル時間 2,410 ms
コンパイル使用メモリ 159,816 KB
実行使用メモリ 8,344 KB
最終ジャッジ日時 2023-10-26 01:10:48
合計ジャッジ時間 6,369 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,672 KB
testcase_01 AC 2 ms
7,672 KB
testcase_02 AC 2 ms
7,672 KB
testcase_03 AC 2 ms
7,672 KB
testcase_04 AC 2 ms
7,672 KB
testcase_05 AC 3 ms
7,672 KB
testcase_06 AC 3 ms
7,672 KB
testcase_07 AC 3 ms
7,672 KB
testcase_08 AC 2 ms
7,672 KB
testcase_09 AC 2 ms
7,672 KB
testcase_10 AC 3 ms
7,672 KB
testcase_11 AC 3 ms
7,672 KB
testcase_12 AC 3 ms
7,672 KB
testcase_13 AC 3 ms
7,672 KB
testcase_14 AC 3 ms
7,672 KB
testcase_15 AC 2 ms
7,672 KB
testcase_16 AC 2 ms
7,672 KB
testcase_17 AC 2 ms
7,672 KB
testcase_18 AC 2 ms
7,672 KB
testcase_19 AC 2 ms
7,672 KB
testcase_20 AC 2 ms
7,672 KB
testcase_21 AC 2 ms
7,672 KB
testcase_22 AC 2 ms
7,672 KB
testcase_23 AC 2 ms
7,672 KB
testcase_24 AC 2 ms
7,672 KB
testcase_25 AC 2 ms
7,672 KB
testcase_26 AC 3 ms
7,672 KB
testcase_27 AC 3 ms
7,672 KB
testcase_28 AC 2 ms
7,672 KB
testcase_29 AC 3 ms
7,672 KB
testcase_30 AC 3 ms
7,672 KB
testcase_31 AC 2 ms
7,672 KB
testcase_32 AC 2 ms
7,672 KB
testcase_33 AC 15 ms
8,240 KB
testcase_34 AC 18 ms
8,328 KB
testcase_35 AC 4 ms
7,732 KB
testcase_36 AC 11 ms
8,032 KB
testcase_37 AC 15 ms
8,204 KB
testcase_38 AC 15 ms
8,204 KB
testcase_39 AC 19 ms
8,344 KB
testcase_40 AC 18 ms
8,344 KB
testcase_41 AC 18 ms
8,304 KB
testcase_42 AC 19 ms
8,344 KB
testcase_43 AC 6 ms
7,796 KB
testcase_44 AC 12 ms
8,108 KB
testcase_45 AC 17 ms
8,292 KB
testcase_46 AC 10 ms
8,004 KB
testcase_47 AC 11 ms
8,016 KB
testcase_48 AC 3 ms
7,712 KB
testcase_49 AC 19 ms
8,344 KB
testcase_50 AC 4 ms
7,760 KB
testcase_51 AC 3 ms
7,724 KB
testcase_52 AC 4 ms
7,732 KB
testcase_53 AC 19 ms
8,344 KB
testcase_54 AC 12 ms
8,076 KB
testcase_55 AC 19 ms
8,344 KB
testcase_56 AC 7 ms
7,876 KB
testcase_57 AC 19 ms
8,344 KB
testcase_58 AC 6 ms
7,788 KB
testcase_59 AC 18 ms
8,332 KB
testcase_60 AC 7 ms
7,876 KB
testcase_61 AC 21 ms
8,344 KB
testcase_62 AC 19 ms
8,344 KB
testcase_63 AC 6 ms
7,816 KB
testcase_64 AC 17 ms
8,304 KB
testcase_65 AC 9 ms
7,936 KB
testcase_66 AC 3 ms
7,728 KB
testcase_67 AC 7 ms
7,876 KB
testcase_68 AC 4 ms
7,752 KB
testcase_69 AC 16 ms
8,228 KB
testcase_70 AC 11 ms
8,036 KB
testcase_71 AC 6 ms
7,836 KB
testcase_72 AC 4 ms
7,744 KB
testcase_73 AC 8 ms
7,908 KB
testcase_74 AC 5 ms
7,820 KB
testcase_75 AC 11 ms
8,000 KB
testcase_76 AC 7 ms
7,876 KB
testcase_77 AC 16 ms
8,224 KB
testcase_78 AC 11 ms
8,036 KB
testcase_79 AC 6 ms
7,804 KB
testcase_80 AC 4 ms
7,772 KB
testcase_81 AC 5 ms
7,760 KB
testcase_82 AC 13 ms
8,120 KB
testcase_83 AC 21 ms
8,344 KB
testcase_84 AC 21 ms
8,344 KB
testcase_85 AC 21 ms
8,344 KB
testcase_86 AC 21 ms
8,344 KB
testcase_87 AC 21 ms
8,344 KB
testcase_88 AC 21 ms
8,344 KB
testcase_89 AC 21 ms
8,344 KB
testcase_90 AC 21 ms
8,344 KB
testcase_91 AC 20 ms
8,344 KB
testcase_92 AC 21 ms
8,344 KB
testcase_93 AC 3 ms
7,672 KB
testcase_94 AC 2 ms
7,672 KB
testcase_95 AC 15 ms
8,344 KB
testcase_96 AC 16 ms
8,344 KB
testcase_97 AC 16 ms
8,344 KB
testcase_98 AC 15 ms
8,344 KB
testcase_99 AC 19 ms
8,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 300010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
ll A[MAX_N];
ll S[MAX_N];

int loop(int l, int r) {
	int d = r - l;
	// debug(vi(A + l, A + r), 1.0 * (S[r] - S[l]) / d);
	int at = lower_bound(A + l, A + r, (S[r] - S[l] + d - 1) / d) - A;
	int res = 0;
	if(at == l) res = 1;
	else res = ((1 - loop(l, at)) | (1 - loop(at, r)));
	// debug(res);
	return res;
}

void solve() {
	cin >> N;
	rep(i, 0, N) {
		cin >> A[i];
		S[i + 1] = S[i] + A[i];
	}
	if(loop(0, N)) cout << "First\n";
	else cout << "Second\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
	srand((unsigned int)time(NULL));
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}

0