結果

問題 No.2239 Friday
ユーザー 👑 tatt61880tatt61880
提出日時 2023-03-11 23:45:34
言語 Kuin
(KuinC++ v.2021.9.17)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 504 bytes
コンパイル時間 2,172 ms
コンパイル使用メモリ 145,536 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-18 10:23:02
合計ジャッジ時間 2,863 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

func main()
	var a: int :: cui@inputInt()
	var b: int :: cui@inputInt()
	if(a > b)
		var tmp: int :: b
		do b :: a
		do a :: tmp
	end if
	
	var ans: int :: 100
	
	; B個のエビフライのうちi個を正しく乗せる。
	; A個のアジは、b - (a - i) 個正しく乗っていることになる。
	for i(0, a)
		var ok: int :: i + (b - (a - i))
		var ng: int :: a + b - ok
		var diff: int :: (ok - ng).abs()
		if(diff < ans)
			do ans :: diff
		end if
	end for
	do cui@print("\{ans}\n")
end func
0