結果
問題 |
No.2174 3 O'clock Easy
|
ユーザー |
![]() |
提出日時 | 2022-12-22 11:56:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 43 ms / 2,000 ms |
コード長 | 321 bytes |
コンパイル時間 | 196 ms |
コンパイル使用メモリ | 82,976 KB |
実行使用メモリ | 60,412 KB |
最終ジャッジ日時 | 2024-11-21 07:40:07 |
合計ジャッジ時間 | 1,166 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
def one(n): k=n//3 return 3*k*(k+1)//2-2*k def two(n): k=n//3 return 3*k*(k+1)*(2*k+1)//2-3*k*(k+1)+k def three(n): k=n//3 return 27*(k*(k+1)//2)**2 N=int(input()) res=0 for i in range(1,N+1): if i%3==1: res+=i elif i%3==2: res+=i*i else: res+=i*i*i print(res)