結果

問題 No.446 ゆきこーだーの雨と雪 (1)
ユーザー takepantakepan
提出日時 2016-11-18 23:52:14
言語 PHP
(8.3.4)
結果
AC  
実行時間 16 ms / 2,000 ms
コード長 664 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 18,624 KB
実行使用メモリ 18,936 KB
最終ジャッジ日時 2023-08-17 12:23:30
合計ジャッジ時間 1,583 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
18,792 KB
testcase_01 AC 15 ms
18,828 KB
testcase_02 AC 14 ms
18,716 KB
testcase_03 AC 14 ms
18,740 KB
testcase_04 AC 14 ms
18,772 KB
testcase_05 AC 14 ms
18,896 KB
testcase_06 AC 14 ms
18,936 KB
testcase_07 AC 15 ms
18,592 KB
testcase_08 AC 15 ms
18,900 KB
testcase_09 AC 15 ms
18,712 KB
testcase_10 AC 14 ms
18,900 KB
testcase_11 AC 14 ms
18,756 KB
testcase_12 AC 15 ms
18,868 KB
testcase_13 AC 16 ms
18,720 KB
testcase_14 AC 15 ms
18,924 KB
testcase_15 AC 16 ms
18,796 KB
testcase_16 AC 16 ms
18,772 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    fscanf (STDIN, "%s", $A);
    fscanf (STDIN, "%s", $B);

    // $a = "10";
    // $a = "100";
    // $a = "0";
    // $a = "01";
    // $arr = array("0", "01", "10");

    // foreach ($arr as $b) {
    // 	hantei($b);
    // }

    function hantei($a) {
	    if (preg_match("/^(0|[1-9][0-9]+)$/", $a)) {
	    	// echo "OK\n";
	    	return true;
	    } else {
	    	// echo "NG\n";
	    	return false;
	    }
    }

    if (hantei($A) === false) {
    	exit("NG\n");
    }
    if (hantei($B) === false) {
    	exit("NG\n");
    }

    if ($A <= 12345 && $B <= 12345) {
    	echo "OK\n";
    	// echo ($A + $B) . "\n";
    } else {
    	echo "NG\n";
    }
0