結果
| 問題 |
No.1208 anti primenumber game
|
| コンテスト | |
| ユーザー |
沙耶花
|
| 提出日時 | 2020-08-30 13:30:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 550 bytes |
| コンパイル時間 | 2,324 ms |
| コンパイル使用メモリ | 194,008 KB |
| 最終ジャッジ日時 | 2025-01-13 21:13:39 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 34 WA * 10 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:16:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
16 | for(int i=0;i<N;i++)scanf("%lld",&A[i]);
| ~~~~~^~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 1000000000
int main(){
int N;
cin>>N;
long long M;
cin>>M;
vector<long long> A(N);
for(int i=0;i<N;i++)scanf("%lld",&A[i]);
vector<long long> p(2,0LL);
int now = 0;
int t = 0;
while(now!=N){
if(A[now]==1){
p[t] -= M;
p[t] ++;
now++;
}
else{
p[t] += A[now]-1;
A[now] = 1;
}
t^=1;
}
if(p[0]>p[1])cout<<"First"<<endl;
else cout<<"Second"<<endl;
return 0;
}
沙耶花