結果

問題 No.2174 3 O'clock Easy
ユーザー ShirotsumeShirotsume
提出日時 2022-12-27 02:32:15
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 47 ms / 2,000 ms
コード長 483 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 62,744 KB
最終ジャッジ日時 2024-05-01 09:51:26
合計ジャッジ時間 1,336 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
54,916 KB
testcase_01 AC 40 ms
54,300 KB
testcase_02 AC 47 ms
61,356 KB
testcase_03 AC 40 ms
53,816 KB
testcase_04 AC 39 ms
53,704 KB
testcase_05 AC 40 ms
53,604 KB
testcase_06 AC 41 ms
54,324 KB
testcase_07 AC 43 ms
61,204 KB
testcase_08 AC 46 ms
62,000 KB
testcase_09 AC 47 ms
61,636 KB
testcase_10 AC 47 ms
61,428 KB
testcase_11 AC 47 ms
62,744 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
sys.setrecursionlimit(5 * 10 ** 5)
from pypyjit import set_param
set_param('max_unroll_recursion=-1')
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1

n = ii()
ans = 0
for i in range(1, n + 1):
    if i % 3 == 0:
        ans += i ** 3
    if i % 3 == 1:
        ans += i ** 1
    if i % 3 == 2:
        ans += i ** 2
print(ans)
0