結果
問題 | No.1837 Same but Different |
ユーザー | ygd. |
提出日時 | 2022-02-11 23:24:14 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,685 bytes |
コンパイル時間 | 308 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 65,664 KB |
最終ジャッジ日時 | 2024-06-27 21:46:18 |
合計ジャッジ時間 | 3,511 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 38 ms
52,352 KB |
testcase_01 | AC | 40 ms
52,736 KB |
testcase_02 | AC | 40 ms
52,352 KB |
testcase_03 | AC | 37 ms
52,608 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | AC | 48 ms
62,592 KB |
testcase_16 | AC | 47 ms
61,184 KB |
testcase_17 | AC | 46 ms
61,568 KB |
testcase_18 | AC | 51 ms
64,512 KB |
testcase_19 | AC | 49 ms
63,360 KB |
testcase_20 | AC | 48 ms
62,464 KB |
testcase_21 | AC | 50 ms
62,848 KB |
testcase_22 | AC | 47 ms
61,312 KB |
testcase_23 | AC | 48 ms
62,848 KB |
ソースコード
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()) if N == 5: print("9 12 15 18 21") print("0 3 16 19 37") exit() if N == 8: print("9 12 15 18 21 24 27 30") print("0 3 16 19 22 25 28 43") exit() if N == 11: A = [9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39] B = [0, 3, 16, 19, 22, 25, 28, 31, 34, 37, 49] print(*A) print(*B) exit() if N == 14: A = [9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48] B = [0, 3, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 55] print(*A) print(*B) exit() if N == 17: A = [9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57] B = [0, 3, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 61] print(*A) print(*B) exit() if N%3 == 0: A = [3]; B = [4] for i in range(N-1): if i%3 == 0: A.append(A[-1] + 3) B.append(B[-1] + 3) if i%3 == 1: A.append(A[-1] + 6) B.append(B[-1] + 3) if i%3 == 2: A.append(A[-1] + 3) B.append(B[-1] + 6) elif N%3 == 1: A = [3,6,9,12]; B = [0,7,10,13] for i in range(N-4): if i%3 == 0: A.append(A[-1] + 3) B.append(B[-1] + 3) if i%3 == 1: A.append(A[-1] + 6) B.append(B[-1] + 3) if i%3 == 2: A.append(A[-1] + 3) B.append(B[-1] + 6) else: A = [9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66] B = [0, 3, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67] for i in range(N-20): if i%3 == 0: A.append(A[-1] + 3) B.append(B[-1] + 3) if i%3 == 1: A.append(A[-1] + 6) B.append(B[-1] + 3) if i%3 == 2: A.append(A[-1] + 3) B.append(B[-1] + 6) #print(sum(A),sum(B)) print(*A) print(*B) if __name__ == '__main__': main()