QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#134967#6641. XOR Dicewhsyhyyh#AC ✓1ms3804kbC++141.2kb2023-08-05 10:22:452023-08-05 10:22:58

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:58]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3804kb
  • [2023-08-05 10:22:45]
  • 提交

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;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3600kb

input:

3 2

output:

16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024

result:

ok Correct answer

Test #2:

score: 0
Accepted
time: 1ms
memory: 3664kb

input:

100 60

output:

495360 495872 495420 495932 560896 561408
495360 495872 495420 495932 560896 561408
495360 495872 495420 495932 560896 561408
495360 495872 495420 495932 560896 561408
495360 495872 495420 495932 560896 561408
495360 495872 495420 495932 560896 561408
495360 495872 495420 495932 560896 561408
495360...

result:

ok Correct answer

Test #3:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

99 2

output:

16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 16514 16642 32896 33024
16512 16640 ...

result:

ok Correct answer

Test #4:

score: 0
Accepted
time: 1ms
memory: 3600kb

input:

99 59

output:

487104 490880 487163 490939 970432 974208
487104 490880 487163 490939 970432 974208
487104 490880 487163 490939 970432 974208
487104 490880 487163 490939 970432 974208
487104 490880 487163 490939 970432 974208
487104 490880 487163 490939 970432 974208
487104 490880 487163 490939 970432 974208
487104...

result:

ok Correct answer

Test #5:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

93 17

output:

140352 141440 140369 141457 279616 280704
140352 141440 140369 141457 279616 280704
140352 141440 140369 141457 279616 280704
140352 141440 140369 141457 279616 280704
140352 141440 140369 141457 279616 280704
140352 141440 140369 141457 279616 280704
140352 141440 140369 141457 279616 280704
140352...

result:

ok Correct answer

Test #6:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

100 49

output:

404544 406720 404593 406769 683072 685248
404544 406720 404593 406769 683072 685248
404544 406720 404593 406769 683072 685248
404544 406720 404593 406769 683072 685248
404544 406720 404593 406769 683072 685248
404544 406720 404593 406769 683072 685248
404544 406720 404593 406769 683072 685248
404544...

result:

ok Correct answer

Test #7:

score: 0
Accepted
time: 1ms
memory: 3596kb

input:

100 5

output:

41280 41920 41285 41925 123200 123840
41280 41920 41285 41925 123200 123840
41280 41920 41285 41925 123200 123840
41280 41920 41285 41925 123200 123840
41280 41920 41285 41925 123200 123840
41280 41920 41285 41925 123200 123840
41280 41920 41285 41925 123200 123840
41280 41920 41285 41925 123200 123...

result:

ok Correct answer

Test #8:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

1 57

output:

470592 474240 470649 474297 937536 941184

result:

ok Correct answer

Test #9:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

1 22

output:

181632 183040 181654 183062 361856 363264

result:

ok Correct answer

Test #10:

score: 0
Accepted
time: 1ms
memory: 3736kb

input:

1 60

output:

495360 499200 495420 499260 986880 990720

result:

ok Correct answer

Test #11:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

1 2

output:

16512 16640 16514 16642 32896 33024

result:

ok Correct answer

Test #12:

score: 0
Accepted
time: 1ms
memory: 3668kb

input:

10 24

output:

198144 199168 198168 199192 329216 330240
198144 199168 198168 199192 329216 330240
198144 199168 198168 199192 329216 330240
198144 199168 198168 199192 329216 330240
198144 199168 198168 199192 329216 330240
198144 199168 198168 199192 329216 330240
198144 199168 198168 199192 329216 330240
198144...

result:

ok Correct answer