結果
問題 |
No.633 バスの運賃
|
ユーザー |
👑 |
提出日時 | 2019-04-29 10:02:02 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 288 bytes |
コンパイル時間 | 697 ms |
コンパイル使用メモリ | 5,504 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-23 22:34:45 |
合計ジャッジ時間 | 1,198 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
local ior = io.input() local n = ior:read("*n") local a = {} for i = 1, n - 1 do a[i] = ior:read("*n") end local ret = 0 local hito = 0 for i = 1, n - 1 do local b, c = ior:read("*n", "*n") hito = hito + c - b ret = ret + a[i] * hito end ior:read("*n", "*n") --unused print(ret)