結果

問題 No.2 素因数ゲーム
ユーザー 鶴田浩之鶴田浩之
提出日時 2020-04-14 14:57:06
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 708 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 32,400 KB
実行使用メモリ 32,912 KB
最終ジャッジ日時 2024-04-09 05:22:52
合計ジャッジ時間 2,443 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 40 ms
32,344 KB
testcase_04 AC 40 ms
32,528 KB
testcase_05 WA -
testcase_06 AC 40 ms
32,528 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 40 ms
32,400 KB
testcase_10 AC 40 ms
32,656 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 40 ms
32,276 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 RE -
testcase_20 WA -
testcase_21 RE -
testcase_22 WA -
testcase_23 AC 39 ms
32,340 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
No syntax errors detected in Main.php

ソースコード

diff #

<?php

$N = trim(fgets(STDIN));
// 2<= $N <= 100000000
for ($i = 2; $i < 10000; $i++) {
  if (!($N % $i)) {
    $j = 0;
    while ($N % $i) {
      $N = $N/$i;
      $j++;
    }
    $arrays[] = $j;
  }
}

$one = 0;
foreach ($arrays as $array) {
  if ($array = 1) {
    $one++;
  }
}
$twomore = count($arrays) - $one;

if ($twomore % 2) {
  echo "Alice\n";
} else if ($twomore >= 4) {
  echo "Bob\n";
} else if ($twomore = 2) {
  if ($one % 2) {$x = 1;} else {$x = -1;}
  if ($arrays[0] = $arrays[1]) {$y = 1;} else {$y=-1;}
  if ($x * $y = -1) {
    echo "Bob\n";
  } else {
    echo "Alice\n";
  }
} else if ($twomore = 1) {
  if ($arrays[0] % 2) {
    echo "Alice\n";
  } else {
    echo "Bob\n";
  }
}

?>
0