結果

問題 No.2174 3 O'clock Easy
ユーザー rlangevinrlangevin
提出日時 2022-12-30 05:51:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 2,000 ms
コード長 171 bytes
コンパイル時間 235 ms
コンパイル使用メモリ 82,724 KB
実行使用メモリ 60,840 KB
最終ジャッジ日時 2024-05-03 22:37:14
合計ジャッジ時間 1,512 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,916 KB
testcase_01 AC 35 ms
52,316 KB
testcase_02 AC 42 ms
59,432 KB
testcase_03 AC 37 ms
52,364 KB
testcase_04 AC 36 ms
52,196 KB
testcase_05 AC 37 ms
52,296 KB
testcase_06 AC 36 ms
51,872 KB
testcase_07 AC 40 ms
58,416 KB
testcase_08 AC 41 ms
60,560 KB
testcase_09 AC 44 ms
60,100 KB
testcase_10 AC 40 ms
60,840 KB
testcase_11 AC 39 ms
60,236 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = 0
for i in range(1, N + 1):
    if i % 3 == 1:
        ans += i
    elif i % 3 == 2:
        ans += i * i
    else:
        ans += i ** 3
print(ans)
0