結果
| 問題 |
No.2198 Concon Substrings (COuNt-CONstruct Version)
|
| コンテスト | |
| ユーザー |
strangerxxx
|
| 提出日時 | 2023-01-20 23:15:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 841 bytes |
| コンパイル時間 | 266 ms |
| コンパイル使用メモリ | 82,444 KB |
| 実行使用メモリ | 81,220 KB |
| 最終ジャッジ日時 | 2024-06-23 11:18:01 |
| 合計ジャッジ時間 | 20,803 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 47 WA * 57 |
ソースコード
def resolve():
import sys
input = sys.stdin.readline
MOD = 998244353
INF = float("inf")
m = int(input())
if m == 0:
print("a")
return
print("co", end="")
x = m
dp = [1, 1, 0]
y = 1
while x:
b = 1 << int(y**0.5).bit_length()
if y > 2:
while dp[0] < b:
print("c", end="")
dp[0] += 1
while dp[1] < y:
print("o", end="")
dp[1] += dp[0]
if x & 1:
print("n", end="")
dp[2] += dp[1]
if y == 1:
print("o", end="")
dp[1] += 1
elif y == 2:
print("co", end="")
dp[0] += 1
dp[1] += dp[0]
x >>= 1
y <<= 1
# print(dp)
if __name__ == "__main__":
resolve()
strangerxxx