結果

問題 No.16 累乗の加算
ユーザー mencottonmencotton
提出日時 2018-02-01 21:31:27
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
実行時間 -
コード長 642 bytes
コンパイル時間 3,252 ms
コンパイル使用メモリ 104,616 KB
実行使用メモリ 804,376 KB
最終ジャッジ日時 2023-08-29 22:01:15
合計ジャッジ時間 34,162 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 MLE -
testcase_01 MLE -
testcase_02 MLE -
testcase_03 MLE -
testcase_04 MLE -
testcase_05 MLE -
testcase_06 MLE -
testcase_07 MLE -
testcase_08 MLE -
testcase_09 MLE -
testcase_10 MLE -
testcase_11 MLE -
testcase_12 MLE -
testcase_13 MLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.Linq;

namespace _16
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            long[] l = new long[100000000]; l[0] = 1;
            long ret = 0;
            for (int j = 1; j < 100000000; j++)
            {
                l[j] = l[j - 1] * x[0] % 1000003;
            }
            for (int i = 0; i < x[1]; i++)
            {
                ret += l[a[i]];
            }
            Console.WriteLine(ret);
        }
    }
}
0