結果
| 問題 |
No.1256 連続整数列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-16 21:29:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 546 bytes |
| コンパイル時間 | 1,292 ms |
| コンパイル使用メモリ | 166,032 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-21 01:19:36 |
| 合計ジャッジ時間 | 2,008 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 22 WA * 4 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
ll A; cin >> A;
A *= 2;
for (ll i = 1; i * i <= A; i++) {
if (A % i == 0) {
ll x, y, N, M;
x = i, y = A / i;
if ((x + y - 1) % 2 != 0) continue;
if (x < y) swap(x, y);
N = (x + y - 1) / 2;
M = (x - y - 1) / 2;
if (N <= 0 || M <= 0) continue;
if (M + 3 > N) continue;
cout << "YES" << '\n';
return 0;
}
}
cout << "NO" << '\n';
return 0;
}