QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#226246 | #6641. XOR Dice | xuxubaobao | WA | 0ms | 3672kb | C++17 | 789b | 2023-10-25 19:03:40 | 2023-10-25 19:03:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
using PII = pair<int,int>;
using ll = long long;
constexpr int N = 2e6 + 10;
int w[N];
void solve() {
int n, m;
cin >> n >> m;
int k = 1;
for(int i = 1; i <= 5; i ++) {
k = k * 2;
}
ll cur = m;
vector<int> ans;
ans.push_back(cur);
cur *= 2;
for(int i = 2; i <= 6; i ++) {
while(1) {
bool ok = 1;
for(auto v : ans) {
if((v ^ cur) % m) {
ok = 0;
}
}
if(ok) {
ans.push_back(cur);
cur *= 2;
break;
}
else cur *= 2;
}
}
for(int i = 1; i <= n; i ++) {
for(auto v : ans) {
cout << v << " ";
}
cout << "\n";
}
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
t = 1;
while(t --){
solve();
}
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3672kb
input:
3 2
output:
2 4 8 16 32 64 2 4 8 16 32 64 2 4 8 16 32 64
result:
ok Correct answer
Test #2:
score: -100
Wrong Answer
time: 0ms
memory: 3580kb
input:
100 60
output:
60 960 15360 245760 3932160 62914560 60 960 15360 245760 3932160 62914560 60 960 15360 245760 3932160 62914560 60 960 15360 245760 3932160 62914560 60 960 15360 245760 3932160 62914560 60 960 15360 245760 3932160 62914560 60 960 15360 245760 3932160 62914560 60 960 15360 245760 3932160 629145...
result:
wrong answer Integer parameter [name=dice] equals to 3932160, violates the range [0, 1000000]