結果
問題 | No.1256 連続整数列 |
ユーザー |
![]() |
提出日時 | 2020-10-16 21:34:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,107 bytes |
コンパイル時間 | 1,736 ms |
コンパイル使用メモリ | 167,036 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-21 02:45:18 |
合計ジャッジ時間 | 2,625 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 WA * 1 |
ソースコード
#include<bits/stdc++.h> //#include<atcoder/all> using namespace std; //using namespace atcoder; using ll = long long; using Graph = vector<vector<int>>; #define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i)) #define rrep(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i)) #define all(x) (x).begin(),(x).end() #define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w) constexpr ll INF = (ll)1e9; constexpr ll mod = 998244353; constexpr double PI = 3.1415926535897932; template<class T>inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template<class T>inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } int main() { init(); int A; cin >> A; bool ans = false; rep(i, 3, 100000) { ll x = 2 * A - (ll)i * (i - 1); if (x % (2 * i) == 0)ans = true; } if (ans)cout << "YES" << "\n"; else cout << "NO" << "\n"; return 0; }