結果
| 問題 | No.631 Noelちゃんと電車旅行 |
| コンテスト | |
| ユーザー |
keymoon
|
| 提出日時 | 2018-01-05 22:25:05 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 782 bytes |
| 記録 | |
| コンパイル時間 | 2,848 ms |
| コンパイル使用メモリ | 105,728 KB |
| 実行使用メモリ | 45,824 KB |
| 最終ジャッジ日時 | 2024-12-23 06:48:03 |
| 合計ジャッジ時間 | 49,961 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 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.Linq;
using System.Collections.Generic;
class P
{
static void Main()
{
int N = int.Parse(Console.ReadLine());
long[] T = Console.ReadLine().Split().Select(long.Parse).ToArray();
int M = int.Parse(Console.ReadLine());
long[] res = new long[M];
for (int i = 0; i < M; i++)
{
int[] LRD = Console.ReadLine().Split().Select(int.Parse).ToArray();
for (int j = LRD[0] - 1; j < LRD[1]; j++)
{
T[j] += LRD[2];
}
long time = 0;
foreach (var e in T)
{
time = Math.Max(time + 3,e);
}
res[i] = time + 3;
}
Console.WriteLine(string.Join("\n",res));
}
}
keymoon