結果
| 問題 |
No.1256 連続整数列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-16 21:57:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,183 bytes |
| コンパイル時間 | 1,824 ms |
| コンパイル使用メモリ | 190,844 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-21 01:23:20 |
| 合計ジャッジ時間 | 2,536 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 26 |
ソースコード
#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#include<algorithm>//next_permutation
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
#define dec(n) cout << fixed << setprecision(n);
#define large "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
#define small "abcdefghijklmnopqrstuvwxyz"
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;
ll gcd(ll a,ll b){
if(b == 0) return a;
return gcd(b , a % b);
}
const ll MOD = 1000000007;
const ll MAX = 2000001;
ll mod(ll a){
return a % MOD;
}
ll lcm(ll a,ll b){
return (a*b)/gcd(a,b);
}
vector<pair<ll,ll>> prime_factorize(ll n){
vector<pair<ll,ll>> res;
for(ll i=2; i*i <= n; i++){
if(n % i != 0) continue;
ll ex = 0;
while(n % i == 0){
ex++;
n /= i;
}
res.push_back({i,ex});
}
if(n != 1) res.push_back({n,1});
return res;
}
int main(){
ll a; cin >> a;
for(ll i=3; i <= a; i++){
if(i*(i+1)/2 > a){
cout << "No" << endl;
return 0;
}
if((a-i*(i+1)/2) % i == 0){
cout << "Yes" << endl;
return 0;
}
}
cout << "No" << endl;
}