結果

問題 No.139 交差点
ユーザー gigurururugigurururu
提出日時 2015-01-29 23:40:26
言語 Ruby
(3.3.0)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 181 bytes
コンパイル時間 105 ms
コンパイル使用メモリ 11,432 KB
実行使用メモリ 15,356 KB
最終ジャッジ日時 2023-08-26 23:12:06
合計ジャッジ時間 4,097 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
15,284 KB
testcase_01 AC 73 ms
15,356 KB
testcase_02 AC 74 ms
15,304 KB
testcase_03 AC 75 ms
15,172 KB
testcase_04 AC 75 ms
15,172 KB
testcase_05 AC 75 ms
15,052 KB
testcase_06 AC 75 ms
15,304 KB
testcase_07 AC 73 ms
15,140 KB
testcase_08 AC 73 ms
15,144 KB
testcase_09 AC 75 ms
15,152 KB
testcase_10 AC 75 ms
15,152 KB
testcase_11 AC 71 ms
15,080 KB
testcase_12 AC 74 ms
15,176 KB
testcase_13 AC 72 ms
15,248 KB
testcase_14 AC 70 ms
15,144 KB
testcase_15 AC 75 ms
15,256 KB
testcase_16 AC 71 ms
15,036 KB
testcase_17 AC 71 ms
15,292 KB
testcase_18 AC 73 ms
15,164 KB
testcase_19 AC 71 ms
15,140 KB
testcase_20 AC 74 ms
15,276 KB
testcase_21 AC 72 ms
15,100 KB
testcase_22 AC 73 ms
15,064 KB
testcase_23 AC 73 ms
15,252 KB
testcase_24 AC 72 ms
15,172 KB
testcase_25 AC 75 ms
15,252 KB
testcase_26 AC 75 ms
15,148 KB
testcase_27 AC 75 ms
15,152 KB
testcase_28 AC 73 ms
15,120 KB
testcase_29 AC 74 ms
15,308 KB
testcase_30 AC 75 ms
15,256 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

def g;gets.split.map(&:to_i)end
n,l=g
walk=0
time=0
n.times{
  x,w,t=g
  time+=x-walk
  walk=x
  if time%(t*2)>t-w
    time+=t*2-time%(t*2)
  end
  time+=w
  walk+=w
}
p time+l-walk
0