QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#127211#6641. XOR DiceVriance#AC ✓1ms3856kbC++141.3kb2023-07-19 14:10:222023-07-19 14:10:24

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 14:10:24]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3856kb
  • [2023-07-19 14:10:22]
  • 提交

answer

#include <iostream>
#include <cstdio>
#include <cmath>
#include <map>
#include <algorithm>
#include <vector>
#include <cctype>
#include <queue>
using namespace std;
typedef long long ll;
const int maxn=500005;
const int INF=0x7f7f;

inline int read(){
    int x=0,w=1;char c=getchar();
    for(;!isdigit(c);c=getchar())if(c=='-')w=-1;
    for(;isdigit(c);x=(x<<3)+(x<<1)+c-'0',c=getchar());
    return x*w;
}

inline ll readll(){
    ll x=0,w=1;char c=getchar();
    for(;!isdigit(c);c=getchar())if(c=='-')w=-1;
    for(;isdigit(c);x=(x<<3)+(x<<1)+c-'0',c=getchar());
    return x*w;
}

ll a[25];
map<ll,ll>mp;
int judge(int x){
	int p=0;
	while(x){
		if(x&1)p++;
		x>>=1;
	}
	if(p==6)return 1;
	else return 0;
}

ll qpow(ll x,ll k){
	ll ans=1;
	for(;k;x*=x,k>>=1)if(k&1)ans*=x;
	return ans;
}

int main(){
	ll n=read(),d=read();
	for(int k=0,b=1;k<=10;){
		for(int i=0;i<8;i++){
			a[k]=d*b*((i&1)+(i&2)*qpow(2,6)+(i&4)*qpow(2,12));
			if(!mp[a[k]])k++;
			mp[a[k]]=1;
		}
		b++;
	}
	for(int i=0,p=1;p<=n;i++,p++){
//		if(judge(i)){
//			int x=i,c=0;
//			while(x){
//				if(x&1)printf("%d ",a[c]);
//				x>>=1;c++;
//			}
//			p++;
//			printf("\n");
//		}
		for(int i=1;i<=6;i++){
			printf("%d ",a[i]);
		}
		printf("\n");
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3752kb

input:

3 2

output:

2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 

result:

ok Correct answer

Test #2:

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

input:

100 60

output:

60 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
60 7680 7740 983040 ...

result:

ok Correct answer

Test #3:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

99 2

output:

2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 32768 32770 33024 
2 256 258 ...

result:

ok Correct answer

Test #4:

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

input:

99 59

output:

59 7552 7611 966656 966715 974208 
59 7552 7611 966656 966715 974208 
59 7552 7611 966656 966715 974208 
59 7552 7611 966656 966715 974208 
59 7552 7611 966656 966715 974208 
59 7552 7611 966656 966715 974208 
59 7552 7611 966656 966715 974208 
59 7552 7611 966656 966715 974208 
59 7552 7611 966656 ...

result:

ok Correct answer

Test #5:

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

input:

93 17

output:

17 2176 2193 278528 278545 280704 
17 2176 2193 278528 278545 280704 
17 2176 2193 278528 278545 280704 
17 2176 2193 278528 278545 280704 
17 2176 2193 278528 278545 280704 
17 2176 2193 278528 278545 280704 
17 2176 2193 278528 278545 280704 
17 2176 2193 278528 278545 280704 
17 2176 2193 278528 ...

result:

ok Correct answer

Test #6:

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

input:

100 49

output:

49 6272 6321 802816 802865 809088 
49 6272 6321 802816 802865 809088 
49 6272 6321 802816 802865 809088 
49 6272 6321 802816 802865 809088 
49 6272 6321 802816 802865 809088 
49 6272 6321 802816 802865 809088 
49 6272 6321 802816 802865 809088 
49 6272 6321 802816 802865 809088 
49 6272 6321 802816 ...

result:

ok Correct answer

Test #7:

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

input:

100 5

output:

5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 81920 81925 82560 
5 640 645 ...

result:

ok Correct answer

Test #8:

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

input:

1 57

output:

57 7296 7353 933888 933945 941184 

result:

ok Correct answer

Test #9:

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

input:

1 22

output:

22 2816 2838 360448 360470 363264 

result:

ok Correct answer

Test #10:

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

input:

1 60

output:

60 7680 7740 983040 983100 990720 

result:

ok Correct answer

Test #11:

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

input:

1 2

output:

2 256 258 32768 32770 33024 

result:

ok Correct answer

Test #12:

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

input:

10 24

output:

24 3072 3096 393216 393240 396288 
24 3072 3096 393216 393240 396288 
24 3072 3096 393216 393240 396288 
24 3072 3096 393216 393240 396288 
24 3072 3096 393216 393240 396288 
24 3072 3096 393216 393240 396288 
24 3072 3096 393216 393240 396288 
24 3072 3096 393216 393240 396288 
24 3072 3096 393216 ...

result:

ok Correct answer