結果

問題 No.756 チャンパーノウン定数 (1)
ユーザー cielciel
提出日時 2018-12-06 12:09:18
言語 Perl
(5.38.2)
結果
AC  
実行時間 6 ms / 2,000 ms
コード長 381 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 5,336 KB
実行使用メモリ 5,156 KB
最終ジャッジ日時 2023-10-12 02:37:46
合計ジャッジ時間 1,234 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
5,028 KB
testcase_01 AC 6 ms
5,080 KB
testcase_02 AC 6 ms
4,908 KB
testcase_03 AC 5 ms
5,156 KB
testcase_04 AC 5 ms
5,080 KB
testcase_05 AC 6 ms
5,004 KB
testcase_06 AC 5 ms
5,116 KB
testcase_07 AC 6 ms
5,116 KB
testcase_08 AC 5 ms
4,948 KB
testcase_09 AC 6 ms
4,888 KB
testcase_10 AC 5 ms
5,116 KB
testcase_11 AC 5 ms
4,972 KB
testcase_12 AC 6 ms
4,888 KB
testcase_13 AC 5 ms
5,148 KB
testcase_14 AC 6 ms
5,124 KB
testcase_15 AC 5 ms
4,888 KB
testcase_16 AC 6 ms
5,012 KB
testcase_17 AC 6 ms
5,156 KB
testcase_18 AC 5 ms
4,872 KB
testcase_19 AC 6 ms
5,112 KB
testcase_20 AC 5 ms
5,116 KB
testcase_21 AC 6 ms
5,068 KB
testcase_22 AC 6 ms
5,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

#!/usr/bin/perl
use strict;
use warnings;
#use bigint;
use feature qw(say);

my $starting=1;
my $bse=10;
while(<>){
	my $n=$_^0;
	$n+=$starting-2;
	my $digits=1;
	my $expbase=1;
	my $x;
	while(($x=$digits*$expbase*($bse-1))<=$n){
		$n-=$x;
		$digits++;
		$expbase*=$bse;
	}
	my $num=$expbase+$n/$digits;
	my $d=$digits-1-$n%$digits;
	for(;$d--;){
		$num/=$bse;
	}
	say $num%$bse;
}
0