QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#127197#6641. XOR DiceVriance#WA 1ms3592kbC++141.3kb2023-07-19 14:02:002023-07-19 14:02:04

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:02:04]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3592kb
  • [2023-07-19 14:02:00]
  • 提交

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

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 2

output:

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

result:

ok Correct answer

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3584kb

input:

100 60

output:

0 60 7680 7740 983040 983100 
0 60 7680 7740 983040 990720 
0 60 7680 7740 983100 990720 
0 60 7680 983040 983100 990720 
0 60 7740 983040 983100 990720 
0 7680 7740 983040 983100 990720 
60 7680 7740 983040 983100 990720 
0 60 7680 7740 983040 990780 
0 60 7680 7740 983100 990780 
0 60 7680 983040 ...

result:

wrong answer Invalid output