結果

問題 No.3084 ゲームブックにトライ!
ユーザー furafura
提出日時 2023-09-13 23:39:00
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 3,593 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 11,336 KB
実行使用メモリ 19,316 KB
最終ジャッジ日時 2023-09-13 23:39:06
合計ジャッジ時間 3,707 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,680 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 17 ms
8,444 KB
testcase_21 AC 17 ms
8,568 KB
testcase_22 AC 17 ms
8,540 KB
testcase_23 AC 17 ms
8,540 KB
testcase_24 AC 17 ms
8,472 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

f = {
    '': 0,
    '0': 1,
    '00': 4,
    '000': 16,
    '0000': 24,
    '00000': 30,
    '000000': 45,
    '0000000': 161,
    '0000001': 91,
    '00000010': 144,
    '000001': 82,
    '0000010': 147,
    '00001': 51,
    '000010': 152,
    '000011': 59,
    '0001': 18,
    '00010': 67,
    '000101': 110,
    '00011': 54,
    '000110': 69,
    '0001101': 77,
    '00011011': 157,
    '000111': 81,
    '0001110': 112,
    '001': 10,
    '0010': 12,
    '00100': 15,
    '001000': 75,
    '0010001': 166,
    '001001': 26,
    '00101': 32,
    '001010': 109,
    '0010100': 155,
    '001011': 106,
    '0010111': 111,
    '00101110': 127,
    '0011': 14,
    '00110': 89,
    '001100': 105,
    '001101': 93,
    '0011010': 170,
    '0011011': 129,
    '00111': 128,
    '001110': 163,
    '01': 3,
    '010': 20,
    '0100': 23,
    '01000': 76,
    '010000': 126,
    '0100001': 146,
    '010001': 135,
    '01001': 150,
    '010011': 164,
    '0101': 31,
    '01010': 40,
    '010100': 70,
    '0101001': 90,
    '010101': 114,
    '0101011': 123,
    '01010110': 138,
    '01011': 47,
    '010110': 61,
    '0101101': 65,
    '01011010': 151,
    '01011011': 100,
    '010110111': 158,
    '011': 6,
    '0110': 17,
    '01100': 21,
    '011000': 60,
    '0110000': 72,
    '0110001': 96,
    '01100010': 121,
    '011000101': 139,
    '01100011': 107,
    '011001': 33,
    '0110010': 49,
    '0110011': 169,
    '01101': 37,
    '011010': 149,
    '011011': 53,
    '0110111': 113,
    '0111': 7,
    '01110': 19,
    '011100': 102,
    '011101': 64,
    '0111011': 98,
    '01111': 116,
    '011110': 133,
    '011111': 132,
    '1': 2,
    '10': 5,
    '100': 27,
    '1000': 38,
    '10000': 57,
    '100000': 71,
    '1000000': 85,
    '10000001': 103,
    '1000001': 145,
    '10000011': 165,
    '100001': 160,
    '10001': 42,
    '100010': 52,
    '100011': 63,
    '1000110': 66,
    '1001': 29,
    '10010': 48,
    '100100': 50,
    '1001000': 156,
    '1001001': 119,
    '10011': 92,
    '100110': 101,
    '1001100': 171,
    '101': 8,
    '1010': 22,
    '10100': 34,
    '101000': 87,
    '1010000': 167,
    '101001': 58,
    '1010010': 137,
    '1010011': 86,
    '10101': 28,
    '101010': 55,
    '1010101': 79,
    '10101011': 108,
    '101010110': 130,
    '101011': 141,
    '1011': 11,
    '10110': 35,
    '101100': 159,
    '101101': 73,
    '1011010': 99,
    '10110101': 115,
    '10111': 13,
    '101110': 84,
    '101111': 97,
    '1011110': 117,
    '1011111': 148,
    '10111110': 153,
    '11': 9,
    '110': 39,
    '1100': 43,
    '11000': 46,
    '110001': 62,
    '1100010': 143,
    '1100011': 95,
    '11001': 44,
    '110010': 56,
    '1100100': 124,
    '11001001': 142,
    '1100101': 172,
    '110011': 74,
    '1101': 80,
    '11010': 83,
    '110100': 88,
    '1101000': 168,
    '110101': 131,
    '1101010': 154,
    '11011': 104,
    '110110': 118,
    '1101101': 134,
    '111': 25,
    '1110': 41,
    '11100': 125,
    '111001': 162,
    '11101': 68,
    '111010': 120,
    '1110101': 136,
    '111011': 78,
    '1110110': 94,
    '1111': 36,
    '11110': 140,
    '11111': 122,
}

g = [None] * 173
for k, v in f.items():
    g[v] = k

s = ''.join(g)
while len(s) >= 8:
    # print(chr(int(s[:8], base=2)), end='')
    s = s[8:]

# Roses are red
# Violets are blue
# Calculate and output
# the following value
# \sum_{i=1}^N \sum_{j=i+1}^N ((A_i+A_j) mod 998244353

n = int(input())
A = list(map(int, input().split()))

ans = 0
mod = 998244353
for i in range(n):
    ans = (ans + A[i])% mod
ans = (ans * (n - 1)) % mod
print(ans)
0