結果

問題 No.254 文字列の構成
ユーザー TawaraTawara
提出日時 2015-08-02 00:35:43
言語 Python2
(2.7.18)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 282 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 6,724 KB
実行使用メモリ 9,812 KB
最終ジャッジ日時 2023-09-25 00:28:53
合計ジャッジ時間 2,437 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
6,872 KB
testcase_01 AC 16 ms
6,864 KB
testcase_02 AC 16 ms
6,672 KB
testcase_03 AC 16 ms
6,864 KB
testcase_04 AC 16 ms
6,672 KB
testcase_05 AC 15 ms
6,768 KB
testcase_06 AC 15 ms
6,748 KB
testcase_07 AC 16 ms
6,684 KB
testcase_08 AC 16 ms
6,852 KB
testcase_09 AC 16 ms
6,712 KB
testcase_10 AC 16 ms
6,684 KB
testcase_11 AC 16 ms
6,684 KB
testcase_12 AC 16 ms
6,860 KB
testcase_13 AC 16 ms
6,744 KB
testcase_14 AC 16 ms
6,700 KB
testcase_15 AC 17 ms
7,032 KB
testcase_16 AC 21 ms
7,752 KB
testcase_17 AC 32 ms
9,812 KB
testcase_18 AC 32 ms
9,808 KB
testcase_19 AC 30 ms
9,200 KB
testcase_20 AC 27 ms
8,708 KB
testcase_21 AC 31 ms
9,276 KB
testcase_22 AC 23 ms
8,096 KB
testcase_23 AC 26 ms
8,672 KB
testcase_24 AC 27 ms
8,568 KB
testcase_25 AC 30 ms
9,168 KB
testcase_26 AC 30 ms
9,504 KB
testcase_27 AC 30 ms
9,444 KB
testcase_28 AC 28 ms
8,780 KB
testcase_29 AC 32 ms
9,560 KB
testcase_30 AC 31 ms
9,260 KB
testcase_31 AC 22 ms
7,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def cs(b,s,N):
	for i in xrange(1,N+1):
		if C[i+1] <= N:
			continue
		return N-C[i], s+[chr(b+(j&1)) for j in range(2*i-1)]
	return 0, s
N = int(raw_input())
C = [i**2 for i in xrange(1<<15)]
N,s = cs(97,[],N)
N,s = cs(99,s,N)
print "".join(s+[chr(101+(k%22)) for k in xrange(N)])
0