結果
問題 |
No.999 てん vs. ほむ
|
ユーザー |
|
提出日時 | 2023-08-25 13:09:53 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 834 bytes |
コンパイル時間 | 2,910 ms |
コンパイル使用メモリ | 106,112 KB |
実行使用メモリ | 62,720 KB |
最終ジャッジ日時 | 2024-12-23 20:59:50 |
合計ジャッジ時間 | 44,775 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 2 TLE * 14 |
コンパイルメッセージ
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.Numerics; namespace yukicoder { public class Program { public static void Main() { var n = int.Parse(Console.ReadLine()); var a = Console.ReadLine().Split().Select(x => long.Parse(x)).ToList(); long s = 0; for(var i = 0; i <= n; i++) { var j = 0; long t = 0; while (j < i) { t += a[j] - a[j + 1]; j += 2; } while (j < 2 * n) { t += a[j + 1] - a[j]; j += 2; } s = Math.Max(t, s); } Console.WriteLine(s); } } }