結果
問題 |
No.1256 連続整数列
|
ユーザー |
![]() |
提出日時 | 2020-10-16 21:24:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 448 bytes |
コンパイル時間 | 1,495 ms |
コンパイル使用メモリ | 163,036 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-06-20 10:42:35 |
合計ジャッジ時間 | 2,638 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 40 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int A; cin >> A; A *= 2; vector<int> f; for (int i = 1; i * i <= A; i++){ if (A % i == 0){ f.push_back(i); f.push_back(A / i); } } bool ok = false; for (int x : f){ int y = A / x - 1; if (x % 2 == y % 2 && y >= 3){ ok = true; } //r+l=x //r-l=y } if (ok){ cout << "YES" << endl; } else { cout << "NO" << endl; } }