結果

問題 No.2655 Increasing Strides
ユーザー kokoseikokosei
提出日時 2024-03-01 22:01:09
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 2,690 ms
コンパイル使用メモリ 243,824 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-01 22:01:14
合計ジャッジ時間 3,988 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 2 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 WA -
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 1 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 WA -
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 1 ms
6,676 KB
testcase_16 AC 1 ms
6,676 KB
testcase_17 WA -
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 1 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 1 ms
6,676 KB
testcase_25 WA -
testcase_26 AC 2 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 2 ms
6,676 KB
testcase_30 AC 1 ms
6,676 KB
testcase_31 AC 1 ms
6,676 KB
testcase_32 AC 2 ms
6,676 KB
testcase_33 WA -
testcase_34 AC 2 ms
6,676 KB
testcase_35 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int N;
int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    cin >> N;
    // 1 + 3 + 5 + ... + N / 2 * 2 - 1
    // 2 + 4 + 6 + ... + N / 2 * 2

    // 1 - ng
    // 2 - ng
    // 3 - ng
    // 4 - ng
    // 5 - ng
    // 6 - ng
    // 7 - ng
    // 8 - ok

    // 2 + 4 + ... + N
    // 1 + 2 + ... + N / 2
    // 1 + 2 + ... + n (n = N / 2)
    // 1 + 2 + ... + n = n * (n + 1) / 2 = s
    // s % 2 == 0, (n % 4 == 0 || n + 1 % 4 == 0)

    cout << ((N > 3 && (N / 2 + 1) % 4 == 0) || N % 8 == 0 ? "Yes\n" : "No\n");
    return 0;
}
0