結果

問題 No.1586 Equal Array
ユーザー mohu moffu
提出日時 2021-07-14 01:34:49
言語 PHP
(843.2)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 614 ms
コンパイル使用メモリ 30,332 KB
実行使用メモリ 34,364 KB
最終ジャッジ日時 2024-07-02 22:28:09
合計ジャッジ時間 2,915 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 12 WA * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
fscanf(STDIN,"%d",$n);
$array = array();
for ($i=0; $i<$n; $i++){
  fscanf(STDIN, "%d", $tmp);
  $array[] = $tmp;
}
$total = 0;
foreach ($array as $element){
  $total += $element;
}
$ans = ($total % $n) == 0 ? 'Yes' : 'No';
echo $ans;
0