結果

問題 No.83 最大マッチング
ユーザー sorchsorch
提出日時 2021-01-07 21:33:55
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 289 bytes
コンパイル時間 733 ms
コンパイル使用メモリ 11,996 KB
実行使用メモリ 13,880 KB
最終ジャッジ日時 2023-08-08 22:03:45
合計ジャッジ時間 1,627 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 6 ms
12,156 KB
testcase_01 WA -
testcase_02 AC 7 ms
12,164 KB
testcase_03 WA -
testcase_04 AC 6 ms
12,152 KB
testcase_05 WA -
testcase_06 AC 7 ms
12,188 KB
testcase_07 WA -
testcase_08 AC 7 ms
12,220 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 8 ms
13,684 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

/**
 * @see https://yukicoder.me/problems/no/83
 */

$input = trim(fgets(STDIN));

const MIN_AMAOUNT = 2;

$remainAmount = $input;
$stackNumbers = [];

while ($remainAmount >= MIN_AMAOUNT) {
    $stackNumbers[] = 1;
    $remainAmount -= 2;
}

echo implode("", $stackNumbers) . "\n";
0