結果

問題 No.2655 Increasing Strides
ユーザー yel
提出日時 2024-03-01 21:41:36
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 466 bytes
コンパイル時間 2,817 ms
コンパイル使用メモリ 244,764 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-09-29 13:39:43
合計ジャッジ時間 3,685 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int MAX = 1e9;
const int MIN = -1*1e9;
const ll MAXLL = 1e18;
const ll MINLL = -1*1e18;

int main()
{
    ll N,Odd=0,Even=0; cin >> N;
    for(int i = 1; i <= N; i++)
    {
        if(i%2!=0) Odd += i;
        else Even += i/2;
    }
    cout << (Odd%2 == 0 && Even%2 == 0 ? "Yes" : "No") << endl;
    return 0;
}
0