結果

問題 No.1837 Same but Different
ユーザー lloyzlloyz
提出日時 2022-02-12 00:05:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 22 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 10,556 KB
実行使用メモリ 8,640 KB
最終ジャッジ日時 2023-09-10 07:17:02
合計ジャッジ時間 2,839 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 16 ms
7,944 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 16 ms
7,892 KB
testcase_04 AC 21 ms
8,472 KB
testcase_05 AC 20 ms
8,624 KB
testcase_06 AC 21 ms
8,572 KB
testcase_07 AC 20 ms
8,524 KB
testcase_08 AC 21 ms
8,472 KB
testcase_09 AC 21 ms
8,572 KB
testcase_10 AC 21 ms
8,640 KB
testcase_11 AC 21 ms
8,580 KB
testcase_12 AC 22 ms
8,448 KB
testcase_13 AC 22 ms
8,500 KB
testcase_14 AC 21 ms
8,468 KB
testcase_15 AC 18 ms
8,376 KB
testcase_16 AC 17 ms
8,240 KB
testcase_17 AC 18 ms
8,208 KB
testcase_18 AC 19 ms
8,420 KB
testcase_19 AC 18 ms
8,420 KB
testcase_20 AC 18 ms
8,512 KB
testcase_21 AC 18 ms
8,420 KB
testcase_22 AC 17 ms
8,376 KB
testcase_23 AC 19 ms
8,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())

A, B = [], []
for i in range(n):
    A.append(3 * i)
    B.append(7 + 3 * i)
if n % 3 == 1:
    A[0] += 1
elif n % 3 == 2:
    A[0] += 1
    A[1] += 1

res = sum(B) - sum(A)
while res > 0:
    for i in range(n - 1, 1, -1):
        A[i] += 3
        res -= 3
        if res == 0:
            break

print(*A)
print(*B)
0