結果

問題 No.7 プライムナンバーゲーム
ユーザー tenkyu9
提出日時 2018-04-03 03:01:56
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 709 bytes
コンパイル時間 642 ms
コンパイル使用メモリ 80,884 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 07:02:16
合計ジャッジ時間 1,465 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

#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){
						flg=false;
					}
				}
			}
		}
	}
	if(flg){
		cout << "Win" << endl;
	} else {
		cout << "Lose" << endl;
	}

	return 0;
}
0