結果
問題 |
No.2174 3 O'clock Easy
|
ユーザー |
|
提出日時 | 2023-01-11 22:37:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 256 bytes |
コンパイル時間 | 1,939 ms |
コンパイル使用メモリ | 191,600 KB |
最終ジャッジ日時 | 2025-02-10 01:45:47 |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i,l,r) for(ll i=(l);i<(r);++i) int main(){ ll n; cin>>n; ll cnt=0; rep(i,1,n+1){ if(i%3==1) cnt+=i; if(i%3==2) cnt+=i*i; if(i%3==0) cnt+=i*i*i; } cout<<cnt<<endl; }