結果

問題 No.1837 Same but Different
ユーザー ygd.ygd.
提出日時 2022-02-11 23:52:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 958 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 86,804 KB
実行使用メモリ 76,364 KB
最終ジャッジ日時 2023-09-10 06:58:01
合計ジャッジ時間 4,016 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,164 KB
testcase_01 AC 69 ms
71,140 KB
testcase_02 AC 69 ms
71,260 KB
testcase_03 AC 68 ms
70,860 KB
testcase_04 AC 79 ms
76,192 KB
testcase_05 AC 81 ms
76,308 KB
testcase_06 AC 83 ms
76,248 KB
testcase_07 AC 83 ms
76,316 KB
testcase_08 AC 83 ms
76,252 KB
testcase_09 AC 82 ms
76,192 KB
testcase_10 AC 80 ms
76,320 KB
testcase_11 AC 83 ms
76,272 KB
testcase_12 AC 81 ms
76,028 KB
testcase_13 AC 83 ms
76,260 KB
testcase_14 AC 82 ms
75,904 KB
testcase_15 AC 81 ms
76,320 KB
testcase_16 AC 82 ms
76,240 KB
testcase_17 AC 81 ms
76,256 KB
testcase_18 AC 81 ms
76,256 KB
testcase_19 AC 83 ms
76,284 KB
testcase_20 AC 82 ms
76,124 KB
testcase_21 AC 80 ms
76,364 KB
testcase_22 AC 79 ms
76,004 KB
testcase_23 AC 81 ms
76,268 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
#input = sys.stdin.readline #文字列につけてはダメ
input = sys.stdin.buffer.readline #文字列につけてはダメ
#sys.setrecursionlimit(1000000)
#import bisect
#import itertools
#import random
#from heapq import heapify, heappop, heappush
#from collections import defaultdict 
#from collections import deque
#import copy
#import math
#from functools import lru_cache
#@lru_cache(maxsize=None)
#MOD = pow(10,9) + 7
#MOD = 998244353
#dx = [1,0,-1,0]
#dy = [0,1,0,-1]

def main():
    N = int(input())
    A = [3*i for i in range(N)]
    B = [3*i + 7 for i in range(N)]
    if N%3 == 1:
        A[0] += 1
    if N%3 == 2:
        A[0] += 1
        A[1] += 1
    dif = sum(B) - sum(A)
    #print(dif)
    while dif > 0:
        for i in reversed(range(2,N)):
            A[i] += 3
            dif -= 3
            if dif == 0: break
    #print(sum(A),sum(B))
    print(*A)
    print(*B)
            

if __name__ == '__main__':
    main()
0