結果

問題 No.1837 Same but Different
ユーザー chineristACchineristAC
提出日時 2022-02-11 21:59:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,138 bytes
コンパイル時間 458 ms
コンパイル使用メモリ 87,356 KB
実行使用メモリ 79,944 KB
最終ジャッジ日時 2023-09-10 02:22:58
合計ジャッジ時間 5,943 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
74,648 KB
testcase_01 AC 117 ms
74,388 KB
testcase_02 WA -
testcase_03 AC 116 ms
74,412 KB
testcase_04 AC 129 ms
79,628 KB
testcase_05 AC 126 ms
79,584 KB
testcase_06 AC 126 ms
79,804 KB
testcase_07 AC 127 ms
79,772 KB
testcase_08 AC 127 ms
79,808 KB
testcase_09 AC 128 ms
79,796 KB
testcase_10 AC 128 ms
79,792 KB
testcase_11 AC 128 ms
79,308 KB
testcase_12 AC 126 ms
79,812 KB
testcase_13 AC 127 ms
79,480 KB
testcase_14 AC 127 ms
79,296 KB
testcase_15 AC 127 ms
79,588 KB
testcase_16 WA -
testcase_17 AC 126 ms
79,412 KB
testcase_18 AC 126 ms
79,788 KB
testcase_19 AC 126 ms
79,788 KB
testcase_20 WA -
testcase_21 AC 125 ms
79,744 KB
testcase_22 WA -
testcase_23 AC 126 ms
79,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,random,bisect
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations
from math import log,gcd

input = lambda :sys.stdin.readline()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

N = int(input())

if N%3==0:
    A = [3*i for i in range(N)] + [10001]
    B = [3*i+1 for i in range(N)]
    tmp = N
    for i in range(N)[::-1]:
        while tmp and A[i]+3 < A[i+1]:
            A[i] += 3
            tmp -= 3
    
    assert tmp == 0
    print(*A[:N])
    print(*B)

elif N%3==1:
    A = [3*i for i in range(N)] + [10001]
    B = [3*i+1 for i in range(N)]
    tmp = N - 1
    A[-2] += 1
    for i in range(N)[::-1]:
        while tmp and A[i]+3 < A[i+1]:
            A[i] += 3
            tmp -= 3
    
    assert tmp==0
    print(*A[:N])
    print(*B)

else:
    A = [3*i for i in range(N)] + [10001]
    B = [3*i+1 for i in range(N)]
    tmp = N - 2
    A[-2] += 1
    A[-3] += 1
    for i in range(N)[::-1]:
        while tmp and A[i]+3 < A[i+1]:
            A[i] += 3
            tmp -= 3
    
    assert tmp==0
    print(*A[:N])
    print(*B)
0