結果

問題 No.1663 Maximum Remainder
ユーザー 👑 horiesinitihoriesiniti
提出日時 2022-12-27 20:54:50
言語 Ruby
(3.3.0)
結果
AC  
実行時間 142 ms / 2,000 ms
コード長 137 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 11,464 KB
実行使用メモリ 15,264 KB
最終ジャッジ日時 2023-08-14 11:10:00
合計ジャッジ時間 2,457 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 142 ms
15,016 KB
testcase_01 AC 140 ms
15,204 KB
testcase_02 AC 67 ms
15,092 KB
testcase_03 AC 67 ms
15,244 KB
testcase_04 AC 66 ms
15,188 KB
testcase_05 AC 72 ms
15,132 KB
testcase_06 AC 69 ms
15,196 KB
testcase_07 AC 70 ms
15,200 KB
testcase_08 AC 73 ms
15,160 KB
testcase_09 AC 70 ms
15,264 KB
testcase_10 AC 68 ms
15,048 KB
testcase_11 AC 67 ms
15,180 KB
testcase_12 AC 69 ms
15,132 KB
testcase_13 AC 71 ms
15,228 KB
testcase_14 AC 68 ms
15,096 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

a,b,c,d,m=gets.split(" ").map{|e| e.to_i}
ans=0
a.upto(b){|n1|
	c.upto(d){|n2|
		e=(n1+n2)%m
		if ans<e then
			ans=e
		end
	}
}
puts ans
0