結果
| 問題 |
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 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 12 WA * 11 |
ソースコード
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()
ygd.