結果
| 問題 | No.3678 しゃべりすぎた男 |
| コンテスト | |
| ユーザー |
aketijyuuzou
|
| 提出日時 | 2026-09-05 13:12:33 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 2,000 ms |
| + 756µs | |
| コード長 | 1,456 bytes |
| 記録 | |
| コンパイル時間 | 511 ms |
| コンパイル使用メモリ | 113,768 KB |
| 実行使用メモリ | 26,112 KB |
| 最終ジャッジ日時 | 2026-09-05 13:12:40 |
| 合計ジャッジ時間 | 2,943 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 33 |
コンパイルメッセージ
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;
class Program
{
static string InputPattern = "InputX";
static List<string> GetInputList()
{
var WillReturn = new List<string>();
if (InputPattern == "Input1") {
WillReturn.Add("204 507 241 694 2293 -1 -1");
}
else if (InputPattern == "Input2") {
WillReturn.Add("118 378 -1 -1 -1 -1 -1");
}
else if (InputPattern == "Input3") {
WillReturn.Add("1000 1000 1000 1000 1000 1000 1000");
}
else {
string wkStr;
while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
}
return WillReturn;
}
static long[] GetSplitArr(string pStr)
{
return (pStr == "" ? new string[0] : pStr.Split(' ')).Select(pX => long.Parse(pX)).ToArray();
}
static void Main()
{
List<string> InputList = GetInputList();
long[] TArr = GetSplitArr(InputList[0]);
long Sum = 0;
bool Flag = false;
foreach (long EachA in TArr) {
if (EachA == -1 || Flag) {
Flag = true;
Console.WriteLine(-1);
continue;
}
Sum += EachA;
if (6000 - Sum >= 0) {
Console.WriteLine(6000 - Sum);
}
else {
Console.WriteLine(-1);
}
}
}
}
aketijyuuzou