QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#423303 | #8174. Set Construction | lizhous | WA | 0ms | 3712kb | C++14 | 628b | 2024-05-27 22:10:11 | 2024-05-27 22:10:11 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<vector>
#include<cstring>
#include<queue>
#define int long long
#define abs(a) max(a,-(a))
using namespace std;
int T,n,m;
int P(int l,int r)
{
int ret=0;
for(int i=l;i<=r;i++)
{
ret|=(1ll<<i);
}
return ret;
}
signed main()
{
scanf("%lld",&T);
while(T--)
{
scanf("%lld%lld",&n,&m);
m-=2;
cout<<0<<" "<<(1ll<<n)-1<<' ';
if(m==0) continue;
for(int i=1;i<=n;i++)
{
for(int z=0;z<=i;z++)
{
if(i==n-1&&z==0) continue;
cout<<P(z,i)<<' ';
m--;
if(m==0) break;
}
if(m==0) break;
}
cout<<endl;
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3676kb
input:
3 3 5 4 8 60 2
output:
0 7 3 2 6 0 15 3 2 7 6 4 14 0 1152921504606846975
result:
ok AC
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3712kb
input:
30 6 2 6 3 6 4 6 5 6 6 6 7 6 8 6 9 6 10 6 11 6 12 6 13 6 14 6 15 6 16 6 17 6 18 6 19 6 20 6 21 7 2 7 3 7 4 7 5 7 6 7 7 7 8 7 9 7 10 7 11
output:
0 63 0 63 3 0 63 3 2 0 63 3 2 7 0 63 3 2 7 6 0 63 3 2 7 6 4 0 63 3 2 7 6 4 15 0 63 3 2 7 6 4 15 14 0 63 3 2 7 6 4 15 14 12 0 63 3 2 7 6 4 15 14 12 8 0 63 3 2 7 6 4 15 14 12 8 31 0 63 3 2 7 6 4 15 14 12 8 31 30 0 63 3 2 7 6 4 15 14 12 8 31 30 28 0 63 3 2 7 6 4 15 14 12 8 31 30 28 24 0 63...
result:
wrong answer (2 OR 8) is not in A