結果

問題 No.2999 Long Long Friedrice
コンテスト
ユーザー 👑 qand
提出日時 2024-12-16 23:07:51
言語 PyPy3
(8.0.0 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 79 ms / 2,000 ms
+ 258µs
コード長 325 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 66 ms
コンパイル使用メモリ 81,872 KB
実行使用メモリ 134,340 KB
最終ジャッジ日時 2026-10-06 21:07:23
合計ジャッジ時間 4,797 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 6
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
inf = 10**6
x = [[] for _ in range(inf + 1)]
for i in range(n):
	x[a[i]].append(a[i] + b[i])
ok = [0] * (inf + 1)
ok[1] = True
ans = 0
for i in range(inf + 1):
	if not ok[i]:
		continue
	ans = i
	for j in x[i]:
		ok[j] = True
print(ans)
0