結果
問題 |
No.45 回転寿司
|
ユーザー |
![]() |
提出日時 | 2016-07-08 11:34:19 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 4 ms / 5,000 ms |
コード長 | 312 bytes |
コンパイル時間 | 939 ms |
コンパイル使用メモリ | 99,328 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-12 03:37:31 |
合計ジャッジ時間 | 1,744 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 30 |
ソースコード
import std.stdio; import std.algorithm; import std.string; import std.conv; void main() { int[1000] lane; immutable n = readln.chomp.to!int; readln.splitter.map!(to!int).copy(lane[]); foreach (i; 2..n) { lane[i] += lane[0..(i - 1)].reduce!max; } writeln(lane[0..n].reduce!max); }