結果

問題 No.831 都市めぐり
ユーザー lloyzlloyz
提出日時 2022-05-10 23:29:18
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 930 ms / 2,000 ms
コード長 216 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 10,508 KB
実行使用メモリ 86,252 KB
最終ジャッジ日時 2023-09-25 07:52:33
合計ジャッジ時間 5,917 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,744 KB
testcase_01 AC 16 ms
8,128 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 15 ms
7,876 KB
testcase_04 AC 16 ms
7,820 KB
testcase_05 AC 16 ms
7,748 KB
testcase_06 AC 16 ms
7,916 KB
testcase_07 AC 17 ms
7,792 KB
testcase_08 AC 19 ms
8,136 KB
testcase_09 AC 17 ms
7,760 KB
testcase_10 AC 20 ms
8,288 KB
testcase_11 AC 19 ms
8,192 KB
testcase_12 AC 58 ms
11,888 KB
testcase_13 AC 50 ms
11,136 KB
testcase_14 AC 60 ms
11,892 KB
testcase_15 AC 387 ms
40,792 KB
testcase_16 AC 161 ms
21,712 KB
testcase_17 AC 443 ms
47,056 KB
testcase_18 AC 590 ms
58,812 KB
testcase_19 AC 865 ms
83,384 KB
testcase_20 AC 930 ms
86,252 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
if n == 1:
    print(0)
    exit()
A = list(range(1, n + 1))
for i in range(1, n // 2, 2):
    A[i], A[n - i - 1] = A[n - i - 1], A[i]
ans = 0
for i in range(n):
    ans += A[i - 1] * A[i]
print(ans)
0