結果
問題 | No.1837 Same but Different |
ユーザー | ikoma |
提出日時 | 2022-02-11 23:10:03 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 469 bytes |
コンパイル時間 | 1,185 ms |
コンパイル使用メモリ | 87,212 KB |
実行使用メモリ | 77,008 KB |
最終ジャッジ日時 | 2023-09-10 05:41:18 |
合計ジャッジ時間 | 5,754 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 72 ms
71,400 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 71 ms
71,344 KB |
testcase_04 | WA | - |
testcase_05 | AC | 81 ms
76,924 KB |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 82 ms
76,820 KB |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | AC | 84 ms
76,940 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 82 ms
76,544 KB |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | AC | 80 ms
76,616 KB |
testcase_20 | WA | - |
testcase_21 | AC | 82 ms
76,640 KB |
testcase_22 | WA | - |
testcase_23 | WA | - |
ソースコード
def solve(N): A = list(range(3,3*N+1,3)) B = [] th = (N+1)//3 if N%3!=2: for i,a in enumerate(A): B.append(a+(-2 if i<th else 1)) if N%3==1: B[-1]-=1 else: for i in range(N): a = A[i] if i>th: B.append(a+1) elif i==th: B.append(a+2) else: B.append(a-2) print(*A) print(*B) N=int(input()) solve(N)