結果

問題 No.1837 Same but Different
ユーザー 37zigen37zigen
提出日時 2022-02-11 23:45:08
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 463 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 8,748 KB
最終ジャッジ日時 2023-09-10 06:47:22
合計ジャッジ時間 3,044 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,804 KB
testcase_01 AC 16 ms
7,848 KB
testcase_02 AC 16 ms
7,804 KB
testcase_03 AC 16 ms
7,872 KB
testcase_04 WA -
testcase_05 AC 19 ms
8,552 KB
testcase_06 AC 20 ms
8,624 KB
testcase_07 WA -
testcase_08 AC 19 ms
8,648 KB
testcase_09 AC 19 ms
8,644 KB
testcase_10 WA -
testcase_11 AC 19 ms
8,552 KB
testcase_12 AC 20 ms
8,580 KB
testcase_13 WA -
testcase_14 AC 19 ms
8,592 KB
testcase_15 AC 17 ms
8,540 KB
testcase_16 AC 17 ms
8,404 KB
testcase_17 AC 16 ms
8,296 KB
testcase_18 AC 18 ms
8,548 KB
testcase_19 AC 17 ms
8,432 KB
testcase_20 WA -
testcase_21 AC 18 ms
8,616 KB
testcase_22 WA -
testcase_23 AC 17 ms
8,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(N) :
    a = [3*i if (i < 2 * N // 3 + 300) else 3 * (i + 1) for i in range(N)]
    b = [3*i + 1 for i in range(N)] #3*300個多い
    if (N < 10) : 
        for i in range(N):
            b[i] += 100
    if (sum(b)-sum(a)) % 3 != 2: 
        a[-1] += sum(b)-sum(a)
    else : 
        assert((sum(b)-sum(a)) % 3 == 2)
        d = (sum(b) - sum(a))// 3
        a[-2] += d + 1
        a[-1] += 2 * d + 1
    print(*a)
    print(*b)
    
N=int(input())
f(N)
0