結果

問題 No.1081 和の和
ユーザー keymoonkeymoon
提出日時 2021-01-15 01:25:53
言語 C#(csc)
(csc 3.9.0)
結果
WA  
実行時間 -
コード長 563 bytes
コンパイル時間 1,294 ms
コンパイル使用メモリ 111,392 KB
実行使用メモリ 29,504 KB
最終ジャッジ日時 2024-05-03 18:08:42
合計ジャッジ時間 1,897 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
19,072 KB
testcase_01 AC 29 ms
19,328 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;

public static class P
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split().Select(long.Parse).ToArray();
        Console.WriteLine((a.Sum(x => x * (n - 1)) - (a.First() + a.Last()) * (n - 2)) % 1000000007);
    }
}
0