結果
| 問題 |
No.1208 anti primenumber game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-07-24 02:47:17 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 694 bytes |
| コンパイル時間 | 1,731 ms |
| コンパイル使用メモリ | 173,492 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-25 05:31:31 |
| 合計ジャッジ時間 | 4,988 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 36 WA * 8 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n;
ll m, v = 0;
cin >> n >> m;
vector<ll> a(n);
for(auto &&v : a) cin >> v;
sort(a.rbegin(), a.rend());
if(m >= 1){
int turn = 0;
for(int i = 0; i < n; i++){
if(a[i] == 1) break;
v += turn ? -a[i] : a[i];
turn ^= 1;
}
for(int i = 0; i < n; i++){
v += turn ? m : -m;
turn ^= 1;
}
}else{
for(int i = 0; i < n; i++){
v += i & 1 ? -a[i] : a[i];
}
}
cout << (v > 0 ? "First" : "Second") << '\n';
}