結果
| 問題 |
No.2655 Increasing Strides
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-03-01 21:28:56 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 563 bytes |
| コンパイル時間 | 577 ms |
| コンパイル使用メモリ | 70,260 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-09-29 13:30:31 |
| 合計ジャッジ時間 | 1,558 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
#include<iostream>
#include<vector>
#include<cassert>
using namespace std;
bool ok(vector<int>A)
{
long sum=0;
for(int a:A)sum+=a;
if(sum%2==1)return false;
sum/=2;
for(int i=A.size();i--;)
{
sum=abs(sum-A[i]);
}
return sum==0;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N;cin>>N;
vector<int>L,R;
for(int i=1;i<=N;i++)(i%2==1?L:R).push_back(i);
bool ans=true;
if(R.size()>=1&&R.size()<=2)ans=false;
else
{
long n=R.size();
if(n*(n+1)/2%2==1)ans=false;
}
if(L.size()%2==1)ans=false;
cout<<(ans?"Yes":"No")<<endl;
}