結果
| 問題 | No.45 回転寿司 |
| ユーザー |
mban
|
| 提出日時 | 2016-11-02 06:10:09 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 637 bytes |
| 記録 | |
| コンパイル時間 | 917 ms |
| コンパイル使用メモリ | 114,044 KB |
| 実行使用メモリ | 27,916 KB |
| 最終ジャッジ日時 | 2024-11-25 01:23:52 |
| 合計ジャッジ時間 | 3,062 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 RE * 1 |
| other | AC * 30 |
コンパイルメッセージ
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;
using System.Text;
using System.Threading.Tasks;
class Magatro
{
static void Main()
{
int N = int.Parse(Console.ReadLine());
int[] V = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
int[] counter = new int[N];
counter[0] = V[0];
counter[1] = V[1];
for(int i = 0; i < N; i++)
{
for(int j = i + 2; j < N; j++)
{
counter[j] = Math.Max(counter[j], counter[i] + V[j]);
}
}
Console.WriteLine(counter.Max());
}
}
mban