結果
| 問題 |
No.16 累乗の加算
|
| コンテスト | |
| ユーザー |
skewes
|
| 提出日時 | 2015-12-29 20:53:41 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 743 bytes |
| コンパイル時間 | 2,897 ms |
| コンパイル使用メモリ | 105,284 KB |
| 実行使用メモリ | 18,048 KB |
| 最終ジャッジ日時 | 2024-09-19 08:30:36 |
| 合計ジャッジ時間 | 9,511 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 TLE * 1 -- * 11 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
namespace yukicoder
{
class _016
{
static void Main()
{
int[] xn = Array.ConvertAll(Console.ReadLine().Split(' ')
, x => int.Parse(x));
int[] an = Array.ConvertAll(Console.ReadLine().Split(' ')
, x => int.Parse(x));
int ans = 0;
foreach(int a in an)
{
ans += p(xn[0], a);
}
Console.WriteLine(ans % 1000003);
Console.ReadLine();
}
static int p(int x, int a)
{
int ret = 1;
for (int i = 0; i < a; i++)
{
ret = ret * x % 1000003;
}
return ret;
}
}
}
skewes