結果

問題 No.831 都市めぐり
ユーザー %20%20
提出日時 2019-05-24 22:33:59
言語 Perl
(5.38.0)
結果
AC  
実行時間 356 ms / 2,000 ms
コード長 136 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 5,304 KB
最終ジャッジ日時 2023-10-17 12:58:04
合計ジャッジ時間 2,582 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
5,304 KB
testcase_01 AC 3 ms
5,304 KB
testcase_02 AC 4 ms
5,304 KB
testcase_03 AC 3 ms
5,304 KB
testcase_04 AC 3 ms
5,304 KB
testcase_05 AC 4 ms
5,304 KB
testcase_06 AC 3 ms
5,304 KB
testcase_07 AC 4 ms
5,304 KB
testcase_08 AC 5 ms
5,304 KB
testcase_09 AC 3 ms
5,304 KB
testcase_10 AC 5 ms
5,304 KB
testcase_11 AC 5 ms
5,304 KB
testcase_12 AC 21 ms
5,304 KB
testcase_13 AC 19 ms
5,304 KB
testcase_14 AC 22 ms
5,304 KB
testcase_15 AC 151 ms
5,304 KB
testcase_16 AC 65 ms
5,304 KB
testcase_17 AC 180 ms
5,304 KB
testcase_18 AC 233 ms
5,304 KB
testcase_19 AC 344 ms
5,304 KB
testcase_20 AC 356 ms
5,304 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.pl syntax OK

ソースコード

diff #

$N=<>;
exit!print 0if$N==1;
$%=$N;
$i=1;
while($i<$N-$i){
	$%+=$i*($N-$i);
	$%+=($N-$i+1)*($i+1);
	++$i
}
print$%+!($N%2)*$N/2*($N/2+1)
0