結果

問題 No.276 連続する整数の和(1)
ユーザー
提出日時 2016-01-17 22:41:59
言語 PHP
(8.3.4)
結果
WA  
実行時間 -
コード長 247 bytes
コンパイル時間 2,628 ms
コンパイル使用メモリ 32,256 KB
実行使用メモリ 100,140 KB
最終ジャッジ日時 2023-10-20 00:31:47
合計ジャッジ時間 5,398 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

<?php

$in = trim(fgets(STDIN));

$num = [];

for($i = 1; $i <= $in; $i ++){
    $num[] = $i;
}

$sum = array_sum($num);

if($sum % 2 == 0){
    echo 2;
}else if($sum % 3 == 0){
    echo 3;
}else if($sum % 5 == 0){
    echo 5;
}else{
    echo 1;
}
0