結果

問題 No.1837 Same but Different
ユーザー gew1fw
提出日時 2025-06-12 20:55:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 427 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 59,264 KB
最終ジャッジ日時 2025-06-12 20:59:19
合計ジャッジ時間 5,506 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

# Construct A
a = [99, 824]
a += [4353 + i for i in range(n - 2)]

# Construct B
b = list(range(n - 2))  # 0, 1, ..., n-3
if n > 2:
    b.append(n - 2)  # Add next consecutive number
else:
    # For n=3, after 0,1, we add L directly
    pass
# Calculate L
sum_a = sum(a)
sum_b_initial = sum(b)
L = sum_a - sum_b_initial
b.append(L)

# Print the result
print(' '.join(map(str, a)))
print(' '.join(map(str, b)))
0