結果

問題 No.744 循環小数N桁目 Easy
ユーザー papinianuspapinianus
提出日時 2021-06-19 14:57:19
言語 PHP
(8.3.4)
結果
AC  
実行時間 7 ms / 2,000 ms
コード長 582 bytes
コンパイル時間 861 ms
コンパイル使用メモリ 12,064 KB
実行使用メモリ 12,344 KB
最終ジャッジ日時 2023-09-05 00:52:13
合計ジャッジ時間 1,915 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,256 KB
testcase_01 AC 7 ms
12,296 KB
testcase_02 AC 7 ms
12,292 KB
testcase_03 AC 7 ms
12,320 KB
testcase_04 AC 7 ms
12,324 KB
testcase_05 AC 7 ms
12,308 KB
testcase_06 AC 7 ms
12,312 KB
testcase_07 AC 7 ms
12,244 KB
testcase_08 AC 7 ms
12,300 KB
testcase_09 AC 7 ms
12,344 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
declare(strict_types=1);
$phrase = '428571';
$pos = UtilIO::getInt() % 6;
UtilIO::echo($phrase[$pos]);

class UtilIO {
    protected static string $n = PHP_EOL;
    protected function __construct() { }
    public static function getString():string {
        return trim(fgets(STDIN));
    }
    public static function getInt():int {
        return intval(trim(fgets(STDIN)));
    }
    public static function echo(string $str):void {
        echo static::toLine($str);
    }
    public static function toLine(string $str):string {
        return trim($str).static::$n;
    }
}
0