結果

問題 No.687 E869120 and Constructing Array 1
ユーザー ayaaya
提出日時 2019-08-02 14:10:07
言語 PHP
(8.3.4)
結果
AC  
実行時間 17 ms / 1,000 ms
コード長 270 bytes
コンパイル時間 45 ms
コンパイル使用メモリ 18,832 KB
実行使用メモリ 18,908 KB
最終ジャッジ日時 2023-09-18 18:12:28
合計ジャッジ時間 905 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,680 KB
testcase_01 AC 15 ms
18,836 KB
testcase_02 AC 15 ms
18,860 KB
testcase_03 AC 16 ms
18,908 KB
testcase_04 AC 16 ms
18,732 KB
testcase_05 AC 17 ms
18,756 KB
testcase_06 AC 15 ms
18,652 KB
testcase_07 AC 16 ms
18,848 KB
testcase_08 AC 16 ms
18,888 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
$array=array();
$ans;
$exit=false;
for($i=1;$i<=10;$i++){
  array_push($array,$i);
}
$N=(int)trim(fgets(STDIN));
while($exit===false){
$random=rand(1,10);
$exit=array_search($N-$random,$array);
  if($exit!==false){
  $ans=$random." ".($exit+1);
  echo $ans;
  }
}
0