結果

問題 No.2655 Increasing Strides
ユーザー てんぷらてんぷら
提出日時 2024-02-28 17:03:47
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 813 bytes
コンパイル時間 5,407 ms
コンパイル使用メモリ 308,888 KB
実行使用メモリ 10,260 KB
最終ジャッジ日時 2024-02-29 21:59:32
合計ジャッジ時間 14,133 ms
ジャッジサーバーID
(参考情報)
judge11 / 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 2 ms
6,676 KB
testcase_05 AC 3 ms
6,676 KB
testcase_06 AC 2 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 3 ms
6,676 KB
testcase_10 AC 3 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 3 ms
6,676 KB
testcase_13 AC 3 ms
6,676 KB
testcase_14 AC 2 ms
6,676 KB
testcase_15 AC 3 ms
6,676 KB
testcase_16 AC 3 ms
6,676 KB
testcase_17 AC 4 ms
6,676 KB
testcase_18 AC 32 ms
6,676 KB
testcase_19 AC 67 ms
6,676 KB
testcase_20 AC 123 ms
6,676 KB
testcase_21 AC 209 ms
6,676 KB
testcase_22 AC 217 ms
6,676 KB
testcase_23 AC 774 ms
6,676 KB
testcase_24 AC 1,085 ms
6,676 KB
testcase_25 TLE -
testcase_26 TLE -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <atcoder/all>
#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define REP(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
using namespace std;
using namespace atcoder;
using mint = modint998244353;
const int inf = 1000000007;
const ll longinf = 1ll << 60;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    bitset<524288> dp1, dp2;
    int m = 262144;
    dp1[m] = dp2[m] = 1;
    REP(i, 1, n + 1) {
        if(i % 2) {
            dp1 = (dp1 << i) | (dp1 >> i);
        } else {
            dp2 = (dp2 << i) | (dp2 >> i);
        }
    }
    if(dp1[m] && dp2[m]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}
0