QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#134965#6631. Maximum Bitwise ORwhsyhyyh#WA 0ms3804kbC++141.2kb2023-08-05 10:22:302023-08-05 10:22:31

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-05 10:22:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3804kb
  • [2023-08-05 10:22:30]
  • 提交

answer

#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2")
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#define N 15
#define rep(i,l,r) for(int i=l;i<=r;i++)
#define drep(i,r,l) for(int i=r;i>=l;i--)
using namespace std;
int rd() {
	int res=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-') f*=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') res=(res<<1)+(res<<3)+(ch^48),ch=getchar();
	return res*f;
}
int n,d;
void work1() {
	rep(i,1,n) {
		int now=0;
		rep(A,0,1) rep(B,0,1) {
			int tmp=d<<13;
			if(!A) tmp^=0;else tmp^=d;
			if(!B) tmp^=d<<6;else tmp^=d<<7;
			printf("%d ",tmp);
		}
		printf("%d %d\n",(d<<6)^(d<<14),(d<<7)^(d<<14));
	}
}
void work2() {
	rep(i,1,n) {
		int now=0;
		rep(A,0,1) rep(B,0,1) {
			int tmp=d<<13;
			if(!A) tmp^=0;else tmp^=d;
			if(!B) tmp^=d<<6;else tmp^=(d<<7)^(d<<6);
			printf("%d ",tmp);
		}
		printf("%d %d\n",(d<<6)^(d<<14)^(d<<13),(d<<7)^(d<<6)^(d<<14)^(d<<13));
	}
}
int main() {
	n=rd(),d=rd();
	if(n&1) work1();
	else work2();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3804kb

input:

1
3 2
10 10 5
1 2
1 3

output:

24768 24960 24771 24963 49344 49536

result:

wrong answer 1st numbers differ - expected: '15', found: '24768'