結果

問題 No.254 文字列の構成
ユーザー tailstails
提出日時 2015-07-24 23:37:23
言語 Perl
(5.38.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 179 bytes
コンパイル時間 128 ms
コンパイル使用メモリ 5,216 KB
実行使用メモリ 4,668 KB
最終ジャッジ日時 2023-09-22 23:49:56
合計ジャッジ時間 1,941 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,480 KB
testcase_01 AC 3 ms
4,456 KB
testcase_02 AC 2 ms
4,580 KB
testcase_03 AC 3 ms
4,444 KB
testcase_04 AC 2 ms
4,576 KB
testcase_05 AC 2 ms
4,588 KB
testcase_06 AC 3 ms
4,524 KB
testcase_07 AC 3 ms
4,604 KB
testcase_08 AC 2 ms
4,604 KB
testcase_09 AC 3 ms
4,568 KB
testcase_10 AC 2 ms
4,580 KB
testcase_11 AC 3 ms
4,564 KB
testcase_12 AC 2 ms
4,568 KB
testcase_13 AC 3 ms
4,440 KB
testcase_14 AC 2 ms
4,516 KB
testcase_15 AC 2 ms
4,452 KB
testcase_16 AC 3 ms
4,652 KB
testcase_17 AC 3 ms
4,584 KB
testcase_18 AC 3 ms
4,668 KB
testcase_19 AC 3 ms
4,524 KB
testcase_20 AC 3 ms
4,504 KB
testcase_21 AC 2 ms
4,584 KB
testcase_22 AC 2 ms
4,624 KB
testcase_23 AC 2 ms
4,636 KB
testcase_24 AC 3 ms
4,668 KB
testcase_25 AC 3 ms
4,476 KB
testcase_26 AC 3 ms
4,576 KB
testcase_27 AC 2 ms
4,496 KB
testcase_28 AC 2 ms
4,492 KB
testcase_29 AC 2 ms
4,628 KB
testcase_30 AC 3 ms
4,500 KB
testcase_31 AC 3 ms
4,636 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Unquoted string "ab" may clash with future reserved word at Main.pl line 2.
Main.pl syntax OK

ソースコード

diff #

$n=<>;
$l=ab;
while($n){
	$r=2+sqrt($n)|0;
	while($r*($r+1)>$n){
		--$r;
	}
	print$l x$r;
	$n-=$r*($r+1);
	if($n>=$r+1){
		print substr $l,0,1;
		$n-=$r+1;
	}
	$l=~y/a-z/c-zab/;
}
0