QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#226246#6641. XOR DicexuxubaobaoWA 0ms3672kbC++17789b2023-10-25 19:03:402023-10-25 19:03:41

Judging History

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

  • [2023-10-25 19:03:41]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3672kb
  • [2023-10-25 19:03:40]
  • 提交

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]