結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,868 KB
testcase_01 WA -
testcase_02 AC 16 ms
7,864 KB
testcase_03 AC 16 ms
7,840 KB
testcase_04 WA -
testcase_05 AC 19 ms
8,576 KB
testcase_06 AC 19 ms
8,632 KB
testcase_07 WA -
testcase_08 AC 19 ms
8,564 KB
testcase_09 AC 19 ms
8,600 KB
testcase_10 WA -
testcase_11 AC 20 ms
8,548 KB
testcase_12 AC 19 ms
8,552 KB
testcase_13 WA -
testcase_14 AC 19 ms
8,568 KB
testcase_15 AC 17 ms
8,528 KB
testcase_16 WA -
testcase_17 AC 18 ms
8,308 KB
testcase_18 AC 18 ms
8,456 KB
testcase_19 AC 18 ms
8,504 KB
testcase_20 WA -
testcase_21 AC 18 ms
8,568 KB
testcase_22 WA -
testcase_23 AC 18 ms
8,448 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[-1] += d + 1
        a[-2] += 2 * d + 1
    
    print(*a)
    print(*b)
N=int(input())
f(N)
0