結果

問題 No.239 にゃんぱすー
ユーザー ayaaya
提出日時 2019-07-31 16:06:23
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 494 bytes
コンパイル時間 47 ms
コンパイル使用メモリ 18,612 KB
実行使用メモリ 19,064 KB
最終ジャッジ日時 2023-09-18 16:01:23
合計ジャッジ時間 2,090 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
18,840 KB
testcase_01 AC 16 ms
18,692 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 16 ms
18,864 KB
testcase_05 WA -
testcase_06 AC 16 ms
18,836 KB
testcase_07 AC 16 ms
18,868 KB
testcase_08 AC 16 ms
18,920 KB
testcase_09 WA -
testcase_10 AC 16 ms
18,912 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 16 ms
18,840 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 16 ms
18,844 KB
testcase_21 WA -
testcase_22 AC 16 ms
18,936 KB
testcase_23 AC 16 ms
18,804 KB
testcase_24 AC 17 ms
18,776 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 16 ms
18,820 KB
testcase_28 AC 16 ms
18,756 KB
testcase_29 WA -
testcase_30 AC 16 ms
18,844 KB
testcase_31 AC 15 ms
18,876 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 16 ms
18,880 KB
testcase_35 WA -
testcase_36 AC 16 ms
18,924 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$num=trim(fgets(STDIN));
$inputArray;
$ans=null;
$cnt=0;
for($i=1;$i<=$num;$i++){
  $input=explode(" ",trim(fgets(STDIN)));
  $inputArray[$i-1]=$input;
} 

for($i=0;$i<=$num-1;$i++){
  if($cnt==0&&$cnt!=$num-1){
   $ans=null;
   break; 
  }
   
  for($x=0;$x<=$num-1;$x++){
    if($inputArray[$x][$i]=="nyanpass"){
      $cnt++;
      if($cnt==$num-1){
        $ans=$i+1;
        break;
      }
    }
  }
  if(!(is_null($ans))){
    break;
  }
}
if(is_null($ans)){
  $ans=-1;
}
echo $ans;
0