結果

問題 No.1837 Same but Different
コンテスト
ユーザー gew1fw
提出日時 2025-06-12 16:15:34
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 427 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 246 ms
コンパイル使用メモリ 95,852 KB
実行使用メモリ 83,712 KB
最終ジャッジ日時 2026-07-11 16:15:36
合計ジャッジ時間 5,149 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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