結果
| 問題 | No.1336 Union on Blackboard |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-02-19 17:44:43 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 2,000 ms |
| コード長 | 468 bytes |
| 記録 | |
| コンパイル時間 | 2,570 ms |
| コンパイル使用メモリ | 107,648 KB |
| 実行使用メモリ | 20,480 KB |
| 最終ジャッジ日時 | 2026-04-05 12:27:04 |
| 合計ジャッジ時間 | 4,548 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
}