結果

問題 No.313 π
ユーザー LeonardoneLeonardone
提出日時 2015-12-07 01:17:30
言語 PHP
(8.3.4)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 547 bytes
コンパイル時間 65 ms
コンパイル使用メモリ 18,700 KB
実行使用メモリ 18,940 KB
最終ジャッジ日時 2023-10-12 19:21:10
合計ジャッジ時間 2,725 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
18,840 KB
testcase_01 AC 31 ms
18,692 KB
testcase_02 AC 31 ms
18,872 KB
testcase_03 AC 31 ms
18,896 KB
testcase_04 AC 31 ms
18,920 KB
testcase_05 AC 31 ms
18,892 KB
testcase_06 AC 31 ms
18,868 KB
testcase_07 AC 31 ms
18,756 KB
testcase_08 AC 31 ms
18,800 KB
testcase_09 AC 31 ms
18,752 KB
testcase_10 AC 31 ms
18,852 KB
testcase_11 AC 32 ms
18,868 KB
testcase_12 AC 31 ms
18,832 KB
testcase_13 AC 31 ms
18,884 KB
testcase_14 AC 31 ms
18,892 KB
testcase_15 AC 31 ms
18,760 KB
testcase_16 AC 31 ms
18,928 KB
testcase_17 AC 31 ms
18,796 KB
testcase_18 AC 31 ms
18,940 KB
testcase_19 AC 31 ms
18,660 KB
testcase_20 AC 31 ms
18,688 KB
testcase_21 AC 31 ms
18,856 KB
testcase_22 AC 31 ms
18,884 KB
testcase_23 AC 31 ms
18,900 KB
testcase_24 AC 31 ms
18,712 KB
testcase_25 AC 31 ms
18,716 KB
testcase_26 AC 31 ms
18,736 KB
testcase_27 AC 31 ms
18,832 KB
testcase_28 AC 31 ms
18,812 KB
testcase_29 AC 31 ms
18,884 KB
testcase_30 AC 31 ms
18,872 KB
testcase_31 AC 31 ms
18,684 KB
testcase_32 AC 31 ms
18,832 KB
testcase_33 AC 31 ms
18,736 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
/* yukicoder My Practice
 * author: Leonardone @ NEETSDKASU
 */

// 解説読後
// http://yukicoder.me/problems/686/editorial


$f = fgets(STDIN);

$c = strlen($f);

$a = [0,0,0,0,0, 0,0,0,0,0];

for ($i = 0; $i < $c; $i++) {
	if ($f[$i] === '.') {
		continue;
	}
	$a[intval($f[$i])]++;
}


$b = array(20105, 20063, 19892, 20011, 19874, 20199, 19898, 20163, 19956, 19841);

$w = -1;
$c = -1;

for ($i = 0; $i < 10; $i++) {
	$d = $b[$i] - $a[$i];
	if ($d < 0) {
		$w = $i;
	} else if ($d > 0) {
		$c = $i;
	}
	
}

echo "{$w} {$c}", PHP_EOL;
0