QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#304783#8004. Bit Componentucup-team992#WA 1ms3752kbC++17841b2024-01-14 02:56:592024-01-14 02:57:00

Judging History

你现在查看的是最新测评结果

  • [2024-01-14 02:57:00]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3752kb
  • [2024-01-14 02:56:59]
  • 提交

answer

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

typedef int uci;
#define int long long
#define F first
#define S second
#define ar array

void solve(){
    int n;
    cin >> n;
    int val = -1;
    for(int i{1}; i < 20; ++i){
        if((1<<i)-1 == n){
            val = i;
        }
    }
    if(val == -1){
        cout << "NO\n";
        return;
    }

    vector<int> v;
    v.push_back(1);
    for(int i{2}; i <= val; ++i){
        vector<int> ne;
        ne.push_back(1<<(i-1));
        for(int j = v.size()-1; j >= 0; --j){
            ne.push_back((1<<(i-1)) | v[j]);
        }
        for(int i : v)
            ne.push_back(i);
        v.swap(ne);
    }
    cout << "YES\n";
    for(int i : v)
        cout << i << ' ';
    cout << '\n';
}

uci main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    solve();
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3512kb

input:

1

output:

YES
1 

result:

ok answer is 1

Test #2:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

2

output:

NO

result:

ok answer is 0

Test #3:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

3

output:

YES
2 3 1 

result:

ok answer is 1

Test #4:

score: 0
Accepted
time: 0ms
memory: 3724kb

input:

4

output:

NO

result:

ok answer is 0

Test #5:

score: 0
Accepted
time: 0ms
memory: 3456kb

input:

5

output:

NO

result:

ok answer is 0

Test #6:

score: 0
Accepted
time: 0ms
memory: 3752kb

input:

6

output:

NO

result:

ok answer is 0

Test #7:

score: 0
Accepted
time: 0ms
memory: 3500kb

input:

7

output:

YES
4 5 7 6 2 3 1 

result:

ok answer is 1

Test #8:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

8

output:

NO

result:

ok answer is 0

Test #9:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

9

output:

NO

result:

ok answer is 0

Test #10:

score: 0
Accepted
time: 0ms
memory: 3580kb

input:

10

output:

NO

result:

ok answer is 0

Test #11:

score: 0
Accepted
time: 0ms
memory: 3476kb

input:

11

output:

NO

result:

ok answer is 0

Test #12:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

12

output:

NO

result:

ok answer is 0

Test #13:

score: -100
Wrong Answer
time: 0ms
memory: 3540kb

input:

13

output:

NO

result:

wrong answer Jury has the answer, participant doesn't