結果
| 問題 |
No.756 チャンパーノウン定数 (1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-12-06 12:18:21 |
| 言語 | PHP (843.2) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 338 bytes |
| コンパイル時間 | 208 ms |
| コンパイル使用メモリ | 31,128 KB |
| 実行使用メモリ | 31,548 KB |
| 最終ジャッジ日時 | 2024-09-14 02:29:57 |
| 合計ジャッジ時間 | 1,995 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 6 WA * 14 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
#!/usr/bin/php
<?php
$starting=1;
$bse=10;
while($s=fgets(STDIN)){
$n=$s; // cannot intval
$n+=$starting-2;
$digits=1;
$expbase=1;
$x;
while(($x=$digits*$expbase*($bse-1))<=$n){
$n-=$x;
$digits++;
$expbase*=$bse;
}
$num=$expbase+$n/$digits;
$d=$digits-1-$n%$digits;
for(;$d--;){
$num/=$bse;
}
echo $num%$bse.PHP_EOL;
}