結果

問題 No.904 サメトロ
ユーザー cielciel
提出日時 2019-01-24 06:57:44
言語 Ruby
(3.3.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 167 bytes
コンパイル時間 32 ms
コンパイル使用メモリ 7,552 KB
実行使用メモリ 12,544 KB
最終ジャッジ日時 2024-04-21 13:35:07
合計ジャッジ時間 10,661 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 223 ms
12,416 KB
testcase_01 AC 178 ms
12,544 KB
testcase_02 AC 322 ms
12,416 KB
testcase_03 AC 190 ms
12,288 KB
testcase_04 AC 340 ms
12,544 KB
testcase_05 AC 179 ms
12,160 KB
testcase_06 AC 437 ms
12,416 KB
testcase_07 AC 195 ms
12,288 KB
testcase_08 AC 614 ms
12,416 KB
testcase_09 AC 178 ms
12,160 KB
testcase_10 AC 209 ms
12,416 KB
testcase_11 AC 202 ms
12,288 KB
testcase_12 AC 175 ms
12,160 KB
testcase_13 AC 192 ms
12,288 KB
testcase_14 AC 181 ms
12,288 KB
testcase_15 AC 173 ms
12,416 KB
testcase_16 AC 213 ms
12,288 KB
testcase_17 AC 175 ms
12,288 KB
testcase_18 AC 178 ms
12,160 KB
testcase_19 AC 181 ms
12,288 KB
testcase_20 AC 174 ms
12,288 KB
testcase_21 AC 189 ms
12,288 KB
testcase_22 AC 497 ms
12,416 KB
testcase_23 AC 198 ms
12,288 KB
testcase_24 AC 271 ms
12,544 KB
testcase_25 AC 175 ms
12,160 KB
testcase_26 AC 195 ms
12,544 KB
testcase_27 TLE -
testcase_28 AC 177 ms
12,160 KB
testcase_29 AC 174 ms
12,160 KB
testcase_30 AC 175 ms
12,288 KB
testcase_31 AC 175 ms
12,160 KB
testcase_32 AC 175 ms
12,160 KB
testcase_33 AC 173 ms
12,416 KB
testcase_34 AC 175 ms
12,288 KB
testcase_35 AC 192 ms
12,416 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

n=gets.to_i-1
a,b=$<.map{|e|e.split.map &:to_i}.transpose
sa,sb=[a,b].map(&:sum)
p (0..10**6).count{|x|
	x+sa-sb>=0 && x<=sb && (0...n).all?{|i|
		a[i]+b[i]<=x+sa
	}
}
0