結果
問題 | No.1837 Same but Different |
ユーザー | chineristAC |
提出日時 | 2022-02-11 22:15:47 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 59 ms / 2,000 ms |
コード長 | 1,680 bytes |
コンパイル時間 | 448 ms |
コンパイル使用メモリ | 82,396 KB |
実行使用メモリ | 68,548 KB |
最終ジャッジ日時 | 2024-06-27 19:27:18 |
合計ジャッジ時間 | 3,141 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 45 ms
56,768 KB |
testcase_01 | AC | 46 ms
56,852 KB |
testcase_02 | AC | 45 ms
56,244 KB |
testcase_03 | AC | 47 ms
57,296 KB |
testcase_04 | AC | 58 ms
68,164 KB |
testcase_05 | AC | 58 ms
67,988 KB |
testcase_06 | AC | 58 ms
68,500 KB |
testcase_07 | AC | 58 ms
67,424 KB |
testcase_08 | AC | 59 ms
67,548 KB |
testcase_09 | AC | 59 ms
68,172 KB |
testcase_10 | AC | 59 ms
68,548 KB |
testcase_11 | AC | 58 ms
68,144 KB |
testcase_12 | AC | 58 ms
67,812 KB |
testcase_13 | AC | 58 ms
68,512 KB |
testcase_14 | AC | 58 ms
68,032 KB |
testcase_15 | AC | 58 ms
66,784 KB |
testcase_16 | AC | 54 ms
65,184 KB |
testcase_17 | AC | 55 ms
66,456 KB |
testcase_18 | AC | 57 ms
67,508 KB |
testcase_19 | AC | 58 ms
67,192 KB |
testcase_20 | AC | 58 ms
66,732 KB |
testcase_21 | AC | 57 ms
67,064 KB |
testcase_22 | AC | 54 ms
66,844 KB |
testcase_23 | AC | 57 ms
66,784 KB |
ソースコード
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)] if N >= 14: tmp = N - 14 A[-2] += 7 A[-3] += 7 else: if N==5: A = [5,6,7,8,9] B = [1,2,3,4,25] print(*A) print(*B) exit() elif N==8: A = [10,11,12,13,14,15,16,17] B = [1,2,3,4,5,6,7,87] print(*A) print(*B) exit() elif N == 11: A = [30+i for i in range(11)] B = [1,2,3,4,5,6,7,8,9,10,sum(A)-55] print(*A) print(*B) exit() 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)