結果
問題 | No.2655 Increasing Strides |
ユーザー |
|
提出日時 | 2024-03-01 21:24:44 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 19 ms / 2,000 ms |
コード長 | 770 bytes |
コンパイル時間 | 810 ms |
コンパイル使用メモリ | 75,380 KB |
最終ジャッジ日時 | 2025-02-19 22:16:41 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include<iostream> #include<algorithm> #include<vector> using namespace std; using ll=long long; #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() template<class T> bool chmax(T &a, T b){if (a < b){a = b;return true;} else return false;} template<class T> bool chmin(T &a, T b){if (a > b){a = b;return true;} else return false;} int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int N; cin>>N; vector<int>A,B; for(int i=1;i<=N;i++){ if(i%2==1)A.push_back(i); else B.push_back(i); } int a=A.size(),b=B.size(); if(a%2==1){ cout<<"No\n"; }else{ ll c=0; for(int i=0;i<b;i++)c+=B[i]; c/=2; if(c%2==1)cout<<"No\n"; else cout<<"Yes\n"; } }