結果
| 問題 | No.3491 右結合的総乗 |
| コンテスト | |
| ユーザー |
kidodesu
|
| 提出日時 | 2026-04-03 21:50:47 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 501 bytes |
| 記録 | |
| コンパイル時間 | 184 ms |
| コンパイル使用メモリ | 84,736 KB |
| 実行使用メモリ | 75,136 KB |
| 最終ジャッジ日時 | 2026-04-03 21:51:05 |
| 合計ジャッジ時間 | 4,074 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 25 RE * 15 |
ソースコード
n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
S = list(map(int, input().split()))
B = [0] * (n+1)
#C = [[0 for _ in range(n+1)] for _ in range(n+1)]
T = []
for s in S:
B[s] = 1
T.append(s)
while T:
now = T.pop()
for s in S:
j = A[s + now]
if not B[j]:
B[j] = 1
T.append(j)
for i in range(n+1):
if not B[i]: continue
for j in range(n+1):
if not B[j]: continue
assert B[A[i+j]]
print(sum(B))
kidodesu