結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,392 KB
testcase_01 AC 71 ms
71,604 KB
testcase_02 WA -
testcase_03 AC 74 ms
71,596 KB
testcase_04 WA -
testcase_05 AC 184 ms
76,744 KB
testcase_06 AC 193 ms
77,368 KB
testcase_07 WA -
testcase_08 AC 188 ms
76,828 KB
testcase_09 AC 186 ms
77,152 KB
testcase_10 WA -
testcase_11 AC 184 ms
77,036 KB
testcase_12 AC 188 ms
77,380 KB
testcase_13 WA -
testcase_14 AC 187 ms
77,152 KB
testcase_15 AC 107 ms
77,124 KB
testcase_16 WA -
testcase_17 AC 95 ms
76,796 KB
testcase_18 AC 124 ms
77,044 KB
testcase_19 AC 117 ms
76,748 KB
testcase_20 WA -
testcase_21 AC 112 ms
76,968 KB
testcase_22 WA -
testcase_23 AC 104 ms
77,000 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)
    
elif n % 3 == 2:
    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