結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー takepantakepan
提出日時 2017-06-02 22:33:07
言語 PHP
(8.3.4)
結果
AC  
実行時間 979 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 4,166 ms
コンパイル使用メモリ 32,344 KB
実行使用メモリ 32,724 KB
最終ジャッジ日時 2023-10-22 00:40:02
合計ジャッジ時間 7,886 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
32,724 KB
testcase_01 AC 67 ms
32,724 KB
testcase_02 AC 60 ms
32,724 KB
testcase_03 AC 104 ms
32,724 KB
testcase_04 AC 38 ms
32,724 KB
testcase_05 AC 38 ms
32,724 KB
testcase_06 AC 39 ms
32,724 KB
testcase_07 AC 38 ms
32,724 KB
testcase_08 AC 39 ms
32,724 KB
testcase_09 AC 80 ms
32,724 KB
testcase_10 AC 979 ms
32,724 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
    fscanf (STDIN, "%d", $N);
    $a = 1;
    $b = 1;
    $c = $N - 2;

    while (true) {
        printf("%d %d %d\n", $a, $b, $c);
        if ($b + 2 <= $c) {
            $c--;
            $b++;
        } else {
            $a++;
            $b = $a;
            $c = $N - $a * 2;
        }
        if (($a > $b) || ($b > $c)) exit;
    }
0