結果
| 問題 | No.2999 Long Long Friedrice |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-02-06 11:04:08 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 324 bytes |
| 記録 | |
| コンパイル時間 | 163 ms |
| コンパイル使用メモリ | 85,280 KB |
| 実行使用メモリ | 82,304 KB |
| 最終ジャッジ日時 | 2026-06-27 09:38:41 |
| 合計ジャッジ時間 | 6,143 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 -- * 3 |
| other | AC * 5 TLE * 1 -- * 27 |
ソースコード
import sys
sys.setrecursionlimit(10 ** 8)
from collections import defaultdict
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
D=defaultdict(list)
for i,j in zip(A,B):
D[i].append(i+j)
ans=1
def dfs(x):
global ans
ans=max(ans,x)
for i in D[x]:
dfs(i)
dfs(1)
print(ans)