結果

問題 No.207 世界のなんとか
ユーザー kitaji93kitaji93
提出日時 2020-08-12 15:01:50
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 32,144 KB
実行使用メモリ 32,660 KB
最終ジャッジ日時 2024-04-18 00:34:03
合計ジャッジ時間 1,596 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 39 ms
31,068 KB
testcase_07 AC 38 ms
31,240 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 38 ms
31,212 KB
testcase_17 AC 37 ms
31,168 KB
testcase_18 AC 39 ms
31,136 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php
list($a, $b) = explode(" ", trim(fgets(STDIN)));

for ($i = $a; $i <= $b; $i++) {
  if ($i % 3 === 0) {
    echo $i;
    echo PHP_EOL;
    continue;
  }
  if (containThreeInt($i)) {
    echo $i;
    echo PHP_EOL;
  }
}

function containThree($i)
{
  return (strpos((string)$i, '3') !== false);
}

function containThreeInt($i)
{
  while ($i > 10) {
    if ($i % 10 === 3) {
      return true;
    }
    $i = $i / 10;
  }
  return false;
}
0