結果

問題 No.1256 連続整数列
ユーザー YamaKasa
提出日時 2020-10-17 01:03:49
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 398 bytes
コンパイル時間 1,551 ms
コンパイル使用メモリ 165,512 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-21 01:36:21
合計ジャッジ時間 2,180 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int func(int n) {
    return (n * (n + 1)) / 2;
}

int main() {
    int A;
    cin >> A;
    for (int i = 3; i * i <= A; i++) {
        int t = 2 * A - i * i - i;
        if (t < 0) break;
        if (t % (2 * (i + 1)) == 0) {
            cout << "YES\n";
            return 0;
        }
    }
    cout << "NO\n";
    return 0;
}
0