結果

問題 No.831 都市めぐり
ユーザー %20%20
提出日時 2019-05-24 22:37:06
言語 Perl
(5.38.2)
結果
AC  
実行時間 335 ms / 2,000 ms
コード長 149 bytes
コンパイル時間 231 ms
コンパイル使用メモリ 5,332 KB
実行使用メモリ 5,336 KB
最終ジャッジ日時 2023-10-17 12:58:33
合計ジャッジ時間 2,359 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

use integer;
$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