結果
| 問題 | No.45 回転寿司 |
| ユーザー |
|
| 提出日時 | 2017-11-23 12:14:33 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 733 bytes |
| 記録 | |
| コンパイル時間 | 534 ms |
| コンパイル使用メモリ | 105,472 KB |
| 実行使用メモリ | 24,832 KB |
| 最終ジャッジ日時 | 2026-05-21 11:59:31 |
| 合計ジャッジ時間 | 13,600 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 4 |
| other | TLE * 1 -- * 29 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Collections.Generic;
using System.Linq;
namespace yuki0045 {
class Program {
static internal List<int> V;
static internal int FindMax(int k) {
return V[ k - 1 ] + ( V.Count() - k <= 1 ? 0 : ( V.Count() - k == 2 ) ? V[ k + 1 ] : Math.Max( FindMax( k + 2 ), FindMax( k + 3 ) ) );
}
static internal int TakeMax(System.IO.TextReader reader) {
V = reader.ReadLine().Split().ToList().ConvertAll( int.Parse );
return V.Count == 1 ? V[ 0 ] : Math.Max( FindMax( 1 ), FindMax( 2 ) );
}
static void Main(string[] args) {
Console.ReadLine();
Console.WriteLine( TakeMax( Console.In ) );
}
}
}