結果

問題 No.547 未知の言語
ユーザー tookunn_1213tookunn_1213
提出日時 2017-08-03 21:44:17
言語 PHP
(8.2.11)
結果
AC  
実行時間 8 ms / 2,000 ms
コード長 1,562 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 12,068 KB
実行使用メモリ 12,376 KB
最終ジャッジ日時 2023-09-08 09:22:48
合計ジャッジ時間 2,232 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
12,280 KB
testcase_01 AC 7 ms
12,196 KB
testcase_02 AC 7 ms
12,320 KB
testcase_03 AC 7 ms
12,296 KB
testcase_04 AC 7 ms
12,296 KB
testcase_05 AC 8 ms
12,240 KB
testcase_06 AC 7 ms
12,256 KB
testcase_07 AC 7 ms
12,280 KB
testcase_08 AC 7 ms
12,284 KB
testcase_09 AC 8 ms
12,308 KB
testcase_10 AC 7 ms
12,228 KB
testcase_11 AC 7 ms
12,376 KB
testcase_12 AC 7 ms
12,224 KB
testcase_13 AC 7 ms
12,280 KB
testcase_14 AC 7 ms
12,280 KB
testcase_15 AC 7 ms
12,260 KB
testcase_16 AC 7 ms
12,328 KB
testcase_17 AC 8 ms
12,304 KB
testcase_18 AC 7 ms
12,280 KB
testcase_19 AC 8 ms
12,240 KB
testcase_20 AC 7 ms
12,284 KB
testcase_21 AC 7 ms
12,288 KB
testcase_22 AC 7 ms
12,304 KB
testcase_23 AC 7 ms
12,296 KB
testcase_24 AC 7 ms
12,244 KB
testcase_25 AC 7 ms
12,284 KB
testcase_26 AC 8 ms
12,244 KB
testcase_27 AC 7 ms
12,352 KB
testcase_28 AC 7 ms
12,236 KB
testcase_29 AC 7 ms
12,216 KB
testcase_30 AC 7 ms
12,300 KB
testcase_31 AC 7 ms
12,252 KB
testcase_32 AC 7 ms
12,316 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    class In {
        private $arr = [];
        private $count = 0;
        private $pointer = 0;

        public function next_line() {
            $ret = "";
            if($this->has_next()){
                while($this->has_next()){
                    $ret .= $this->next();
                }
            }else{
                $ret = trim(fgets(STDIN));
            }
            return $ret;
        }

        public function next() {
            if(!$this->has_next()) {
                $str = trim(fgets(STDIN));
                $this->arr = explode(' ',$str);
                $this->count = count($this->arr);
                $this->pointer = 0;
            }
            $result = $this->arr[$this->pointer];
            $this->pointer++;
            return $result;
        }

        public function has_next() {
            return $this->pointer < $this->count;
        }

        public function next_int() {
            return (int)$this->next();
        }

        public function next_double() {
            return (double)$this->next();
        }
    }

    class Out {
        public static function println($str = "") {
            echo $str . PHP_EOL;
        }
    }

    $in = new In();

    $N = $in->next_int();
    for($i = 0;$i < $N;$i++) {
        $S[] = $in->next();
    }

    for($i = 0;$i < $N;$i++) {
        $T[] = $in->next();
    }

    for($i = 0;$i < $N;$i++) {
        if($S[$i] !== $T[$i]) {
            Out::println($i + 1);
            Out::println($S[$i]);
            Out::println($T[$i]);
        }
    }
?>
0