結果

問題 No.1486 ロボット
ユーザー 👑 tatt61880tatt61880
提出日時 2021-04-30 17:57:36
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 2,173 ms
コンパイル使用メモリ 148,416 KB
実行使用メモリ 4,480 KB
最終ジャッジ日時 2023-10-14 18:26:33
合計ジャッジ時間 3,338 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,480 KB
testcase_02 AC 2 ms
4,352 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 17 ms
4,352 KB
testcase_07 AC 17 ms
4,348 KB
testcase_08 AC 10 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 3 ms
4,348 KB
testcase_11 AC 3 ms
4,352 KB
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 3 ms
4,352 KB
testcase_14 AC 11 ms
4,352 KB
testcase_15 AC 4 ms
4,352 KB
testcase_16 AC 5 ms
4,348 KB
testcase_17 AC 5 ms
4,352 KB
testcase_18 AC 4 ms
4,348 KB
testcase_19 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

func main()
	var a: int :: cui@inputInt()
	var b: int :: cui@inputInt()
	var c: int :: cui@inputInt()
	var d: int :: cui@inputInt()
	var e: int :: cui@inputInt()
	var lcm: int :: math@lcm(a + b, c + d)
	var ans: int :: 0
	for i(0, lcm - 1)
		do ans :+ f(i, a, a + b, c, c + d)
	end for
	do ans :* e / lcm
	for i(0, e % lcm - 1)
		do ans :+ f(i, a, a + b, c, c + d)
	end for
	do cui@print("\{ans}\n")
	
	func f(i: int, a: int, ab: int, c: int, cd: int): int
		if(i % ab >= a)
			ret 0
		end if
		if(i % cd >= c)
			ret 0
		end if
		ret 1
	end func
end func
0