結果

問題 No.1208 anti primenumber game
ユーザー
提出日時 2020-10-01 03:43:03
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 805 bytes
コンパイル時間 932 ms
コンパイル使用メモリ 96,724 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-06 19:44:07
合計ジャッジ時間 5,313 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
long long a[200020];
int main() {
    long long n, m;
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    long long f = 0, s = 0;
    sort(a, a + n);
    for (int i = n - 1; i >= 0; i--) {
        if ((n - i) % 2 == 1) {
            f += a[i] - 1;
        }
        else {
            s += a[i] - 1;
        }
    }
    f -= (n + 1) / 2 * m;
    s -= n / 2 * m;
    if (f > s) {
        cout << "First" << endl;
    }
    else {
        cout << "Second" << endl;
    }
    return 0;
}
0