結果

問題 No.1298 OR XOR
ユーザー sahiyasahiya
提出日時 2020-12-08 18:02:56
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,314 bytes
コンパイル時間 1,628 ms
コンパイル使用メモリ 115,076 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-17 18:25:49
合計ジャッジ時間 3,672 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstring>
#include <deque>
#include <forward_list>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef bitset<16> BS;

const ll MOD = 1E+09 + 7;
const ll INF = 1E15;
const int MAX_N = 1E+05;

ll N;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> N;

    vector<int> v;
    for (int i = 0; i <= 30; i++) {
        if ((N >> i) & 1) {
            v.push_back(i);
        }
    }
    ll A = -1, B = -1, C = -1;
    if (v.size() > 1) {
        A = 0, B = 0, C = 0;
        A += (1LL << v[0]), B += (1LL << v[0]);
        for (int i = 1; i < v.size(); i++) {
            B += (1LL << v[1]), C += (1LL << v[1]);
        }
    }

    /*
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            cout << "i = " << i << ", j = " << j << ", dp = " << dp[i][j] << "\n";
        }
    }
    */

    cout << A << " " << B << " " << C << "\n";

    return 0;
}
0