結果

問題 No.831 都市めぐり
ユーザー 🍮かんプリン
提出日時 2019-05-24 22:03:04
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 227 bytes
コンパイル時間 393 ms
コンパイル使用メモリ 55,544 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-17 10:41:52
合計ジャッジ時間 1,102 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 1 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;

int main() {
    int N; cin >> N;
    long long int ans = 0;
    ans += N + N - 1;
    for(int i = N - 1; i >= 1; i--) {
        ans += i * (i + 1) - 1;
    }
    cout << ans << endl;
}
0