結果

問題 No.16 累乗の加算
ユーザー mencottonmencotton
提出日時 2017-12-31 22:03:42
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
実行時間 -
コード長 699 bytes
コンパイル時間 2,353 ms
コンパイル使用メモリ 104,584 KB
実行使用メモリ 21,856 KB
最終ジャッジ日時 2023-08-23 12:36:16
合計ジャッジ時間 8,953 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

namespace Test
{
    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 ret = 0;
            for (int i = 0; i < x[1]; i++)
            {
                long l = 1;
                for (int j = 0; j < a[i]; j++)
                {
                    l *= x[0];
                    l %= 1000003;
                }
                ret += l;
                ret %= 1000003;
            }
            Console.WriteLine(ret);
        }
    }
}
0