結果
| 問題 | No.600 かい文回 |
| コンテスト | |
| ユーザー |
maspy
|
| 提出日時 | 2020-03-18 17:59:57 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 94 ms / 2,000 ms |
| コード長 | 468 bytes |
| 記録 | |
| コンパイル時間 | 331 ms |
| コンパイル使用メモリ | 20,568 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-05-24 20:53:13 |
| 合計ジャッジ時間 | 3,511 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 21 |
ソースコード
#!/usr/bin/env python3.8
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import itertools
N = int(read())
def f(N, i):
i %= 3
a = str(i)
if N == 1:
return a
if N == 2:
return a + a
if N & 1:
return a + f(N - 1, i + 1) + a
return a + a + f((N - 2) // 2, i + 1) + a + a
word = f(N, 0).replace('0', 'a').replace('1', 'b').replace('2', 'c')
print(word)
maspy