結果
| 問題 |
No.9008 空白区切りで与えられる数値データの合計値を求める(テスト用)
|
| ユーザー |
Salvia0911
|
| 提出日時 | 2023-11-05 13:46:11 |
| 言語 | C# (.NET 8.0.404) |
| 結果 |
AC
|
| 実行時間 | 106 ms / 2,000 ms |
| コード長 | 1,803 bytes |
| コンパイル時間 | 10,772 ms |
| コンパイル使用メモリ | 165,840 KB |
| 実行使用メモリ | 183,160 KB |
| 最終ジャッジ日時 | 2024-09-25 22:30:20 |
| 合計ジャッジ時間 | 13,044 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 15 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.csproj を復元しました (85 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
using System;
using System.Collections.Generic;
public class InputStrorage
{
public long N;
public long[] Array;
}
public static class InputHandler
{
public static void ReadInput(InputStrorage input)
{
string[] str = Console.ReadLine().Split();
input.N = int.Parse(str[0]);
input.Array = new long[input.N];
str = Console.ReadLine().Split();
for (int i = 0; i < input.N; i++)
{
input.Array[i] = long.Parse(str[i]);
}
}
}
namespace GeneralLibs
{
public class Compare
{
public static long ReturnMax(long a, long b)
{
if (a > b) return a;
else return b;
}
public static long ReturnMax(long[] a)
{
long max = long.MinValue;
for (int i = 0; i < a.Length; i++)
{
if (a[i] > max) max = a[i];
}
return max;
}
}
public class ShowValues
{
public static void ShowArray1D(long[] a, string str = "default")
{
Console.WriteLine(str);
for (int i = 0; i < a.Length; i++)
{
Console.Write("{0} ", a[i]);
}
Console.WriteLine();
Console.WriteLine(str);
}
public static void ShowValue(long a, string str = "default")
{
Console.WriteLine("{0} : {1}", a, str);
}
}
}
public class SpecificLibs
{
}
static class No9008
{
static void Main()
{
InputStrorage input = new InputStrorage();
InputHandler.ReadInput(input);
long ans = 0;
for(int i = 0; i < input.N; i++)
{
ans += input.Array[i];
}
Console.WriteLine(ans);
}
}
Salvia0911