QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#127121#6641. XOR Dicexiaoxing666#WA 1ms3592kbC++17703b2023-07-19 13:15:322023-07-19 13:15:33

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-19 13:15:33]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3592kb
  • [2023-07-19 13:15:32]
  • 提交

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