結果
| 問題 |
No.7 プライムナンバーゲーム
|
| コンテスト | |
| ユーザー |
tenkyu9
|
| 提出日時 | 2018-04-03 03:03:37 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 720 bytes |
| コンパイル時間 | 678 ms |
| コンパイル使用メモリ | 81,008 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 07:02:17 |
| 合計ジャッジ時間 | 1,325 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 WA * 9 |
ソースコード
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<climits>
#include<set>
#include<utility>
using namespace std;
typedef long long int ll;
int main(){
int n;
cin >> n;
bool flag[10100];
memset(flag, 1, 10100);
int num=2;
while(num<110){
if(flag[num]){
for(int i=2; i<10100/num; i++){
flag[num*i]=false;
}
}
num++;
}
bool flg=true;
for(int i=2; i<10001; i++){
if(flag[i]){
if(n-i>3){
for(int j=2; j<10001; j++){
if(n-i==j+3 && flag[j]){
flg=false;
}
}
}
}
}
if(flg){
cout << "Win" << endl;
} else {
cout << "Lose" << endl;
}
return 0;
}
tenkyu9