結果

問題 No.166 マス埋めゲーム
ユーザー monburan_0401monburan_0401
提出日時 2018-09-17 10:00:10
言語 C
(gcc 12.3.0)
結果
TLE  
実行時間 -
コード長 571 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 28,072 KB
実行使用メモリ 5,952 KB
最終ジャッジ日時 2023-09-25 09:17:22
合計ジャッジ時間 3,127 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 0 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 45 ms
4,380 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 45 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 3 ms
4,376 KB
testcase_12 TLE -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(void){
	long int H,W;		//	H行W列のマス
	long int N;	//	塗る人の人数
	long int K;	//	この番号の人が勝つか負けるかを判断
	long int masu;	//	マスの数
	
	scanf("%ld %ld %ld %ld",&H,&W,&N,&K);
	
	masu = H*W;
	
	while(masu > 0){
		/*for(int i = 1; i <= N; i++){
			masu--;
			if(masu == 0){
				if(i == K){
					printf("YES\n");
				}else{
					printf("NO\n");
				}
			}
		}*/
		masu -= K;
		if(masu == 0){
			printf("YES\n");
			return 0;
		}else if(masu > 0){
			masu -= (N-K);
		}
	}
	printf("NO\n");
	return 0;
}
0