結果

問題 No.164 ちっちゃくないよ!!
ユーザー papinianuspapinianus
提出日時 2016-08-29 14:00:44
言語 PHP
(8.3.4)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 623 bytes
コンパイル時間 6,080 ms
コンパイル使用メモリ 31,136 KB
実行使用メモリ 31,692 KB
最終ジャッジ日時 2024-04-26 17:15:53
合計ジャッジ時間 2,885 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
PHP Deprecated:  Optional parameter $std declared before required parameter $cut is implicitly treated as a required parameter in Main.php on line 13

Deprecated: Optional parameter $std declared before required parameter $cut is implicitly treated as a required parameter in Main.php on line 13
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$alpha = "0123456789abcdefghijklmnopqrstuvwxyz";
$n = trim(fgets(STDIN));
$min = gmp_init("0");
for(; $n; $n--) {
    $str = str_split(trim(fgets(STDIN)));
    $std = stripos($alpha, max($str))+1;
    $tmp = arrayToInt($str, $std, $min);
    if(gmp_cmp($min, 0) == 0 || gmp_cmp($tmp, $min) < 0) {$min = $tmp;}
}
echo gmp_strval($min).PHP_EOL;

function arrayToInt($array, $std = 2, $cut) {
    global $alpha;
    $val = 0;
    $base = 1;
    while(!is_null($char = array_pop($array))) {
        $val = gmp_add(gmp_mul(stripos($alpha,$char),$base), $val);
        $base = gmp_mul($base,$std);
    }
    return $val;
}
0