結果
問題 | No.1097 Remainder Operation |
ユーザー | uni_python |
提出日時 | 2020-06-26 22:46:16 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 938 bytes |
コンパイル時間 | 266 ms |
コンパイル使用メモリ | 87,228 KB |
実行使用メモリ | 126,980 KB |
最終ジャッジ日時 | 2023-09-18 06:32:28 |
合計ジャッジ時間 | 8,157 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 78 ms
71,388 KB |
testcase_01 | AC | 74 ms
71,400 KB |
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 | AC | 317 ms
126,824 KB |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
ソースコード
import sys input=sys.stdin.readline def I(): return int(input()) def MI(): return map(int, input().split()) def LI(): return list(map(int, input().split())) def main(): mod=10**9+7 N=I() A=LI() Q=I() L=[0]*N#L[i]はX=iからの操作後の値 for i in range(N): X=i L[i]=(X + A[X%N]) M=45 dub=[[0]*N for _ in range(M)] for j in range(N): dub[0][j]=j dub[1][j]=L[j] for i in range(2,M): for j in range(N): a=dub[i-1][j]#一つ上 b=a%N jj=a%N diff=dub[i-1][jj]-jj dub[i][j]=a+diff # for i in range(4): # print(dub[i]) for _ in range(Q): K=I() ans=0 for i in range(M): if K>>i &1: ans+=dub[i+1][ans%N] print(ans) main()