結果

問題 No.1307 Rotate and Accumulate
ユーザー 👑 tamatotamato
提出日時 2020-12-04 10:24:29
言語 PyPy3
(7.3.13)
結果
TLE  
実行時間 -
コード長 588 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 71,796 KB
最終ジャッジ日時 2023-10-12 22:46:15
合計ジャッジ時間 9,068 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,520 KB
testcase_01 AC 70 ms
71,336 KB
testcase_02 AC 70 ms
71,316 KB
testcase_03 AC 72 ms
71,764 KB
testcase_04 AC 74 ms
71,496 KB
testcase_05 AC 74 ms
71,492 KB
testcase_06 AC 73 ms
71,796 KB
testcase_07 AC 72 ms
71,652 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N, Q = map(int, input().split())
    A = list(map(int, input().split()))
    A.reverse()
    R = list(map(int, input().split()))

    B = [0] * N
    for r in R:
        B[r] += 1
    S = 0
    for a in A:
        S <<= 30
        S += a
    ans = 0
    for i in range(N):
        ans += S * B[i]
        S >>= 30
        S += A[N-1-i] << (30 * (N-1))
    C = [0] * N
    for i in range(N):
        C[i] = ans % (1<<30)
        ans >>= 30
    print(*C)


if __name__ == '__main__':
    main()
0