結果

問題 No.740 幻の木
ユーザー KamedKamed
提出日時 2019-02-18 14:25:12
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 543 bytes
コンパイル時間 454 ms
コンパイル使用メモリ 54,108 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-15 22:00:09
合計ジャッジ時間 1,104 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
int main()
{
	// 幻の木_740|
	int N = 0, M = 0, P = 0, Q = 0, month = 0, count = 0;
	std::cin >> N;	// 枚数
	std::cin >> M;	// 落とす枚数
	std::cin >> P;	// 強い風が吹き始める月
	std::cin >> Q;	// 強い風が吹き終わる月
	month = 0;		// 今の月
	count = 0;		// カウント

	while(N > 0)
	{
		count++;
		month++;
		if (month == 13)
		{
			month = 1;
		}
		else{}
		if (month >= P && month <= Q)
		{
			N -= 2 * M;
		}
		else
		{
			N -= M;
		}
	}
	std::cout << count << std::endl;
	return 0;
}
0