結果

問題 No.8 N言っちゃダメゲーム
ユーザー mannshi222mannshi222
提出日時 2022-04-24 12:59:58
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 690 bytes
コンパイル時間 1,141 ms
コンパイル使用メモリ 73,744 KB
実行使用メモリ 78,244 KB
最終ジャッジ日時 2023-09-08 06:04:17
合計ジャッジ時間 7,324 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
7,536 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <stdbool.h>
#include <vector>

using namespace std;
#define MAX 120000

vector<bool> wl(MAX, true);


void makewl(int n, int k )
{

	for( int i = 2; i <= n; i++ ) {
		if( i <= k+1 ) {
			wl[i] = true;
			continue;
		}
		bool f = false;
		for( int j = 1; j <= k; j++ ) {
			if( wl[ i - j ] == false ) {
				f = true;
				break;
			}
		}
		if( f ) {
			wl[i] = true;
		}
		else {
			wl[i] = false;
		}
	}
}

bool check( int N,int K ) 
{
	return true;
}
int main()
{
	int P, N, K;
	cin >> P;

	for( int i = 0; i < P; i++ ) {
		cin >> N >> K;
		makewl( N, K );
		if( wl[N]) {
			cout << "Win" << endl;
		}
		else {
			cout << "Lose" << endl;
		}
	}
		
	return 0;
}
0