結果

問題 No.1325 Subsequence Score
ユーザー さかぽんさかぽん
提出日時 2020-12-25 22:31:00
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 278 ms / 2,000 ms
コード長 558 bytes
コンパイル時間 975 ms
コンパイル使用メモリ 111,412 KB
実行使用メモリ 68,092 KB
最終ジャッジ日時 2023-10-23 22:34:30
合計ジャッジ時間 5,993 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
25,284 KB
testcase_01 AC 27 ms
25,284 KB
testcase_02 AC 25 ms
25,284 KB
testcase_03 AC 30 ms
25,724 KB
testcase_04 AC 30 ms
25,628 KB
testcase_05 AC 31 ms
25,760 KB
testcase_06 AC 31 ms
25,628 KB
testcase_07 AC 30 ms
25,724 KB
testcase_08 AC 25 ms
25,284 KB
testcase_09 AC 30 ms
25,620 KB
testcase_10 AC 31 ms
25,620 KB
testcase_11 AC 31 ms
25,628 KB
testcase_12 AC 30 ms
25,628 KB
testcase_13 AC 272 ms
67,560 KB
testcase_14 AC 97 ms
41,984 KB
testcase_15 AC 232 ms
63,876 KB
testcase_16 AC 262 ms
65,620 KB
testcase_17 AC 125 ms
45,968 KB
testcase_18 AC 88 ms
40,428 KB
testcase_19 AC 274 ms
67,980 KB
testcase_20 AC 60 ms
30,680 KB
testcase_21 AC 108 ms
43,816 KB
testcase_22 AC 135 ms
48,672 KB
testcase_23 AC 276 ms
68,092 KB
testcase_24 AC 275 ms
68,088 KB
testcase_25 AC 276 ms
68,088 KB
testcase_26 AC 276 ms
68,088 KB
testcase_27 AC 278 ms
68,088 KB
testcase_28 AC 24 ms
24,988 KB
testcase_29 AC 25 ms
25,284 KB
testcase_30 AC 24 ms
24,988 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class V
{
	static long[] ReadL() => Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
	static void Main()
	{
		var n = int.Parse(Console.ReadLine());
		var a = ReadL();

		if (n == 1)
		{
			Console.WriteLine(a[0] % M);
		}
		else
		{
			var s = a.Select((x, i) => (i + 2) * x % M).Sum() % M;
			Console.WriteLine(s * MPow(2, n - 2) % M);
		}
	}

	const long M = 998244353;
	static long MPow(long b, long i)
	{
		long r = 1;
		for (; i != 0; b = b * b % M, i >>= 1) if ((i & 1) != 0) r = r * b % M;
		return r;
	}
}
0