結果
| 問題 |
No.8 N言っちゃダメゲーム
|
| ユーザー |
youjo_yamioti
|
| 提出日時 | 2018-12-02 09:38:42 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 483 bytes |
| コンパイル時間 | 1,291 ms |
| コンパイル使用メモリ | 161,516 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-28 10:50:00 |
| 合計ジャッジ時間 | 3,141 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 2 RE * 8 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:24: warning: ‘N’ is used uninitialized [-Wuninitialized]
5 | vector<int> judge(N+1,0);
| ~^~
main.cpp:4:11: note: ‘N’ declared here
4 | int P,N,K;
| ^
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
int P,N,K;
vector<int> judge(N+1,0);
cin >> P;
int i;
for(i=0;i<P;i++){
cin >> N >> K;
judge[N-1] = 0;
for(int j=N-2;j>=0;j--){
for(int k=1;k<=K;k++){
if(j + k > N) break;
if(judge[j+k] == 0) judge[j] = 1;
}
}
if(judge[0] == 1) cout << "Win" << endl;
else cout << "Lose" << endl;
}
return 0;
}
youjo_yamioti