結果

問題 No.1208 anti primenumber game
ユーザー ytft
提出日時 2021-05-12 21:26:05
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 113 ms / 2,000 ms
コード長 485 bytes
コンパイル時間 4,941 ms
コンパイル使用メモリ 354,608 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 07:59:41
合計ジャッジ時間 8,722 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 44
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_int.hpp>
namespace mp=boost::multiprecision;
int main(){
    int N;
    long long M;
    cin>>N>>M;
    vector<long long> A(N);
    for(int i=0;i<N;++i){
        cin>>A[i];
    }
    mp::cpp_int temp=0;
    for(int j=N-1;j>=0;--j){
        if(A[j]>1){
            temp=max(A[j]+M-2+temp,A[j]-M-temp);
        }else{
            temp=-temp+1-M;
        }
    }
    cout<<(temp>0?"First":"Second")<<endl;
}
0