結果
問題 |
No.2174 3 O'clock Easy
|
ユーザー |
|
提出日時 | 2022-12-27 02:32:15 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 48 ms / 2,000 ms |
コード長 | 483 bytes |
コンパイル時間 | 332 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 61,184 KB |
最終ジャッジ日時 | 2024-11-21 13:19:59 |
合計ジャッジ時間 | 1,228 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
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)