結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-06 15:21:37
言語 Raku
(rakudo v2024.02)
結果
WA  
実行時間 -
コード長 370 bytes
コンパイル時間 1,867 ms
コンパイル使用メモリ 131,812 KB
実行使用メモリ 132,648 KB
最終ジャッジ日時 2023-10-12 02:45:40
合計ジャッジ時間 13,638 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 472 ms
132,100 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 473 ms
132,356 KB
testcase_07 AC 464 ms
132,396 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 478 ms
132,284 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 445 ms
132,408 KB
testcase_18 AC 459 ms
132,484 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 474 ms
132,368 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

#!/usr/bin/perl6

my $starting=5;
my $bse=10;
loop (;my $s=get();) {
	my $n=$s.Int;
	$n+=$starting-2;
	my $digits=1;
	my $expbase=1;
	my $x;
	loop (;($x=$digits*$expbase*($bse-1)) <= $n;) {
		$n-=$x;
		$digits++;
		$expbase*=$bse;
	}
	my $num=$expbase + ($n div $digits);
	my $d=$digits-1-($n mod $digits);
	loop (;$d--;) {
		$num=$num div $bse;
	}
	say $num mod $bse;
}
0