結果
問題 | No.547 未知の言語 |
ユーザー |
![]() |
提出日時 | 2017-08-03 21:44:17 |
言語 | PHP (843.2) |
結果 |
AC
|
実行時間 | 45 ms / 2,000 ms |
コード長 | 1,562 bytes |
コンパイル時間 | 112 ms |
コンパイル使用メモリ | 32,020 KB |
実行使用メモリ | 32,660 KB |
最終ジャッジ日時 | 2024-06-26 02:27:07 |
合計ジャッジ時間 | 2,516 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 33 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?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]); } } ?>