結果

問題 No.1089 三変数方程式
ユーザー zeronosu77108
提出日時 2020-06-24 21:25:29
言語 C++17(clang)
(clang++ 23.1.3 + boost 1.92.0 + ACL)
コンパイル:
clang++ -O2 -lm -std=c++1z -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 2 ms / 2,000 ms
+ 256µs
コード長 448 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,467 ms
コンパイル使用メモリ 139,736 KB
実行使用メモリ 9,916 KB
最終ジャッジ日時 2026-10-14 15:59:11
合計ジャッジ時間 2,879 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 16
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <climits>
#include <map>
#include <queue>
#include <cmath>

using namespace std;

using int64 = long long;

int main() {
    int n;
    cin >> n;

    int ans = 0;
    for (int i=0; i<=n; i++) {
        for (int j=0; j<=n-i; j++) {
            int k = n - i - j;
            if (0<=k && k<=n) ans++;
        }
    }

    cout << ans << endl;
}
0