結果

問題 No.1081 和の和
ユーザー Yusei KatoYusei Kato
提出日時 2020-06-22 20:08:35
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 63 ms / 2,000 ms
コード長 1,131 bytes
コンパイル時間 1,021 ms
コンパイル使用メモリ 68,320 KB
実行使用メモリ 24,032 KB
最終ジャッジ日時 2023-09-16 19:18:49
合計ジャッジ時間 2,465 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
24,008 KB
testcase_01 AC 61 ms
24,032 KB
testcase_02 AC 61 ms
21,976 KB
testcase_03 AC 59 ms
21,800 KB
testcase_04 AC 61 ms
21,868 KB
testcase_05 AC 61 ms
21,856 KB
testcase_06 AC 62 ms
22,012 KB
testcase_07 AC 63 ms
21,968 KB
testcase_08 AC 63 ms
22,048 KB
testcase_09 AC 62 ms
22,052 KB
testcase_10 AC 63 ms
22,064 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Linq;

namespace Problem1081
{
    class Program
    {
        static void Main(string[] args)
        {
            const long mod = 7 + (long)1e9;
            int N = GetInt();
            var A = GetLongArray();

            for(int i = 0; i < N - 1; i++)
            {
                var Anext = new long[A.Length - 1];
                for(int j = 0; j < Anext.Length; j++)
                {
                    Anext[j] = (A[j] + A[j + 1]) % mod;
                }
                A = Anext;
            }

            Console.WriteLine(A[0]);
        }

        public static int GetInt() => int.Parse(Console.ReadLine());
        public static int[] GetIntArray() => Console.ReadLine().Split().Select(int.Parse).ToArray();
        public static double GetDouble() => double.Parse(Console.ReadLine());
        public static double[] GetDoubleArray() => Console.ReadLine().Split().Select(double.Parse).ToArray();
        public static long GetLong() => long.Parse(Console.ReadLine());
        public static long[] GetLongArray() => Console.ReadLine().Split().Select(long.Parse).ToArray();

    }
}
0