結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 6 ms
5,032 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 6 ms
5,120 KB
testcase_07 AC 6 ms
4,884 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 6 ms
5,140 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 6 ms
4,876 KB
testcase_18 AC 6 ms
4,892 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 6 ms
5,044 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

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

my $starting=5;
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