結果
| 問題 | No.1256 連続整数列 |
| コンテスト | |
| ユーザー |
maguro
|
| 提出日時 | 2020-11-14 21:08:02 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,499 bytes |
| 記録 | |
| コンパイル時間 | 1,895 ms |
| コンパイル使用メモリ | 191,744 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2025-06-20 10:47:13 |
| 合計ジャッジ時間 | 2,663 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 40 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000030;
constexpr ll INF= 2000000000000000000;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<ll,ll> P;
typedef pair<int,P> PP;
template<class T> inline bool chmax(T &a, T b) {
if (a < b) {
a = b;
return 1;
}
return 0;
}
template<class T> inline bool chmin(T &a, T b) {
if (a > b) {
a = b;
return 1;
}
return 0;
}
ll mod(ll val, ll M) {
val = val % M;
if(val < 0) {
val += M;
}
return val;
}
template<typename T>
T RS(T N, T P, T M){
if(P == 0) {
return 1;
}
if(P < 0) {
return 0;
}
if(P % 2 == 0){
ll t = RS(N, P/2, M);
if(M == -1) return t * t;
return t * t % M;
}
if(M == -1) {
return N * RS(N,P - 1,M);
}
return N * RS(N, P-1, M) % M;
}
int main() {
ll A;
cin >> A;
A *= 2;
bool ret = false;
for(ll i = 1;i * i <= A;i++) {
if(A % i == 0) {
if(i != 1 && i != 2) {
if((A / i + 1 - i) % 2 == 0) {
ret = true;
}
}
if(A / i != 1 && A / i != 2) {
if((A / (A / i) + 1 - (A / i)) % 2 == 0) {
ret = true;
}
}
}
}
if(ret == true) {
cout << "YES" << endl;
}
else {
cout << "NO" << endl;
}
}
maguro