結果

問題 No.522 Make Test Cases(テストケースを作る)
ユーザー takepan
提出日時 2017-06-02 22:33:07
言語 PHP
(843.2)
結果
AC  
実行時間 1,083 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 2,532 ms
コンパイル使用メモリ 32,016 KB
実行使用メモリ 31,408 KB
最終ジャッジ日時 2024-09-22 02:02:55
合計ジャッジ時間 6,199 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 11
権限があれば一括ダウンロードができます
コンパイルメッセージ
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