結果

問題 No.1837 Same but Different
ユーザー 👑 rin204rin204
提出日時 2022-02-11 21:59:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 698 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,416 KB
実行使用メモリ 77,524 KB
最終ジャッジ日時 2023-09-10 02:23:37
合計ジャッジ時間 6,836 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 73 ms
71,384 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 187 ms
77,156 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 188 ms
77,296 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 187 ms
77,332 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 106 ms
77,228 KB
testcase_16 WA -
testcase_17 AC 99 ms
77,108 KB
testcase_18 AC 127 ms
77,228 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 104 ms
76,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

A = []
B = []
m = n // 3
for i in range(m):
    A.append(9 * i + 3)
    A.append(9 * i + 6)
    A.append(9 * i + 9)
    B.append(3 * i + 1)
    
for i in range(2 * m):
    B.append(3 * m + 3 * i + 4)

if n % 3 == 1:
    b = B[-1]
    B[-1] += 3
    B.append(b + 6)
    A.append(b + 9)
    
else:
    A[-1] += 3
    A.append(9985)
    B.append(9991)
    B.append(9994)
    A.append(9997)
    
    
print(*A)
print(*B)
    
assert sum(A) == sum(B)
assert max(A) <= 10000
assert max(B) <= 10000
se = set()
for i in range(n):
    for j in range(i + 1, n):
        se.add(A[i] + A[j])
for i in range(n):
    for j in range(i + 1, n):
        assert B[i] + B[j] not in se, (B[i] + B[j])
0