結果

問題 No.254 文字列の構成
ユーザー tktk_snsntktk_snsn
提出日時 2020-12-29 23:39:25
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,264 KB
最終ジャッジ日時 2024-04-16 00:31:09
合計ジャッジ時間 5,423 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 31 ms
10,752 KB
testcase_11 AC 29 ms
10,880 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 AC 31 ms
10,880 KB
testcase_14 AC 31 ms
10,880 KB
testcase_15 AC 35 ms
10,752 KB
testcase_16 AC 53 ms
10,880 KB
testcase_17 AC 168 ms
11,008 KB
testcase_18 AC 166 ms
11,136 KB
testcase_19 AC 122 ms
11,008 KB
testcase_20 AC 151 ms
11,008 KB
testcase_21 WA -
testcase_22 AC 86 ms
11,008 KB
testcase_23 AC 86 ms
10,880 KB
testcase_24 AC 76 ms
11,008 KB
testcase_25 WA -
testcase_26 AC 216 ms
11,008 KB
testcase_27 AC 119 ms
11,008 KB
testcase_28 AC 118 ms
11,136 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 72 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from string import ascii_lowercase


def tmp(N):
    l = 0
    r = 10 ** 6
    while r - l > 1:
        m = (l + r) // 2
        M = m * 2
        if M * (M + 2) // 4 > N:
            r = m
        else:
            l = m
    return l * 2


N = int(input())
ans = ""
L = tmp(N)
for i in range(L):
    if i % 2 == 0:
        ans += "x"
    else:
        ans += "y"
R = N - (L * (L + 2) // 4)
for i in range(R):
    i %= len(ascii_lowercase)
    ans += ascii_lowercase[i]
print(ans)
0