QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#127121 | #6641. XOR Dice | xiaoxing666# | WA | 1ms | 3592kb | C++17 | 703b | 2023-07-19 13:15:32 | 2023-07-19 13:15:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int n, d;
int main()
{
scanf("%d %d", &n, &d);
int k1 = (int)(log2(d & -d) + 1);
int k2 = (int)(log2(d) + 1);
int k = k2 - k1 + 1;
//cout<<k<<endl;
vector<int> ans;
for (int i = 0; i < 6; i++)
{
int tmp = ((d << (k + i)) | d);
ans.push_back(tmp);
}
if (n & 1)
{
for (int i = 1; i <= n; i++)
{
for (int j = 0; j < 6; j++)
{
cout << ans[j] << " \n"[j == 5];
}
}
}
else
{
for (int i = 1; i <= n - 1; i++)
{
for (int j = 0; j < 6; j++)
{
cout << ans[j] << " \n"[j == 5];
}
}
for(int i=0;i<6;i++)
{
cout<<(ans[i]^d)<<" \n"[i==5];
}
}
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3592kb
input:
3 2
output:
6 10 18 34 66 130 6 10 18 34 66 130 6 10 18 34 66 130
result:
ok Correct answer
Test #2:
score: -100
Wrong Answer
time: 1ms
memory: 3524kb
input:
100 60
output:
1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 3900 7740 15420 30780 1020 1980 39...
result:
wrong answer Invalid output