結果
| 問題 |
No.1336 Union on Blackboard
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-19 17:44:43 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 2,000 ms |
| コード長 | 468 bytes |
| コンパイル時間 | 2,892 ms |
| コンパイル使用メモリ | 106,880 KB |
| 実行使用メモリ | 19,840 KB |
| 最終ジャッジ日時 | 2024-09-16 07:17:31 |
| 合計ジャッジ時間 | 3,298 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 31 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System;
using System.Linq;
class B
{
const long M = 1000000007;
static int[] Read() => Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
static void Main() => Console.WriteLine(string.Join("\n", new int[int.Parse(Console.ReadLine())].Select(_ => Solve())));
static object Solve()
{
var n = int.Parse(Console.ReadLine());
var a = Read();
long r = a[0];
for (int i = 1; i < n; i++)
{
r += (1 + r) * a[i];
r %= M;
}
return r;
}
}