提出 #75213715


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;
#define int ll

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

mt19937_64 rng(std::chrono::system_clock::now().time_since_epoch().count());

signed main() {
    cin.tie(0)->sync_with_stdio(0);
    int t;
    cin >> t;
    vector<int>a = {0,1,3,2};
    for(int j = 2; j<20; j++){
        int n = sz(a);
        for(int i = 0; i<n; i++){
            a.push_back(a[i] ^ (1<<j));
        }
    }
    while(t--){
        int n;
        cin >> n;
        for(int i = 0; i<2*n; i++){
            if(a[i] && a[i] <= n){
                cout << a[i] << ' ';
            }
        }
        cout << '\n';
    }
    return 0;
}

提出情報

提出日時
問題 A - Min of Sum of XOR
ユーザ kevinyang
言語 C++23 (GCC 15.2.0)
得点 500
コード長 839 Byte
結果 AC
実行時間 13 ms
メモリ 11820 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 500 / 500
結果
AC × 1
AC × 14
セット名 テストケース
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 7 ms 11648 KiB
01_random_00.txt AC 13 ms 11688 KiB
01_random_01.txt AC 13 ms 11748 KiB
01_random_02.txt AC 13 ms 11820 KiB
01_random_03.txt AC 13 ms 11692 KiB
01_random_04.txt AC 13 ms 11772 KiB
01_random_05.txt AC 13 ms 11736 KiB
01_random_06.txt AC 13 ms 11688 KiB
01_random_07.txt AC 13 ms 11652 KiB
01_random_08.txt AC 13 ms 11776 KiB
01_random_09.txt AC 13 ms 11648 KiB
01_random_10.txt AC 13 ms 11680 KiB
01_random_11.txt AC 12 ms 11760 KiB
01_random_12.txt AC 12 ms 11760 KiB