結果
問題 | No.1307 Rotate and Accumulate |
ユーザー | 👑 tamato |
提出日時 | 2020-12-04 12:28:06 |
言語 | PyPy3 (7.3.13) |
結果 |
TLE
|
実行時間 | - |
コード長 | 617 bytes |
コンパイル時間 | 259 ms |
コンパイル使用メモリ | 87,336 KB |
実行使用メモリ | 267,264 KB |
最終ジャッジ日時 | 2023-10-13 00:33:36 |
合計ジャッジ時間 | 8,011 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,912 KB |
testcase_01 | AC | 72 ms
71,812 KB |
testcase_02 | AC | 74 ms
71,460 KB |
testcase_03 | AC | 73 ms
71,652 KB |
testcase_04 | AC | 77 ms
71,672 KB |
testcase_05 | AC | 73 ms
71,708 KB |
testcase_06 | AC | 72 ms
71,572 KB |
testcase_07 | AC | 74 ms
71,672 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 | -- | - |
ソースコード
mod = 1000000007 eps = 10**-9 mask = (1 << 30) - 1 def main(): import sys input = sys.stdin.readline N, Q = map(int, input().split()) A = list(map(int, input().split())) 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 C = [0] * N for i in range(N-1, -1, -1): ans += S * B[(N - i)%N] C[(i+N-1)%N] = ans & mask ans >>= 30 for i in range(N-2, -1, -1): C[i] += ans & mask ans >>= 30 print(*C) if __name__ == '__main__': main()