結果
問題 |
No.1208 anti primenumber game
|
ユーザー |
|
提出日時 | 2020-09-06 14:46:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,083 bytes |
コンパイル時間 | 1,588 ms |
コンパイル使用メモリ | 168,148 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-29 07:10:04 |
合計ジャッジ時間 | 4,693 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 34 WA * 10 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (int)(n); i ++) #define irep(i,n) for (int i = (int)(n) - 1;i >= 0;--i) using namespace std; using ll = long long; using PL = pair<ll,ll>; using P = pair<int,int>; constexpr int INF = 1000000000; constexpr long long HINF = 1000000000000000; constexpr long long MOD = 1000000007;// = 998244353; constexpr double EPS = 1e-4; constexpr double PI = 3.14159265358979; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int N; ll M; cin >> N >> M; vector<ll> A(N); rep(i,N) cin >> A[i]; ll f = 0,s = 0; int turn = 0; rep(i,N) { if (A[i] > 1) { if (turn == 0) { f += A[i] - 1; s += 1 - M; } else { s += A[i] - 1; f += 1 - M; } } else { if (turn == 0) { f += 1 - M; } else { s += 1 - M; } turn ^= 1; } } cout << (f > s ? "First" : "Second") << '\n'; return 0; }