QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#78617#4820. Kitten's ComputerAppleblue17WA 2ms3304kbC++142.7kb2023-02-19 22:20:412023-02-19 22:20:44

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-19 22:20:44]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3304kb
  • [2023-02-19 22:20:41]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
const int N=1e5+5;

bool debug=false;

ull Data[N];
int tme[N];

void SET(int i,int j){
	if(!debug) printf("SET %d %d\n",i,j);
	Data[i]=Data[j];
	tme[i]=max({tme[j]})+1;
}
void XOR(int i,int j,int k){
	if(!debug) printf("XOR %d %d %d\n",i,j,j);
	Data[i]=Data[j] ^ Data[k];
	tme[i]=max({tme[j],tme[k]})+1;
}
void AND(int i,int j,int k){
	if(!debug) printf("AND %d %d %d\n",i,j,k);
	Data[i]=Data[j] & Data[k];
	tme[i]=max({tme[j],tme[k]})+1;
}
void OR(int i,int j,int k){
	if(!debug) printf("OR %d %d %d\n",i,j,k);
	Data[i]=Data[j] | Data[k];
	tme[i]=max({tme[j],tme[k]})+1;
}
void NOT(int i,int j){
	if(!debug) printf("NOT %d %d\n",i,j);
	Data[i]=~Data[j];
	tme[i]=max({tme[j]})+1;
}
void LSH(int i,int x){
	if(!debug) printf("LSH %d %d\n",i,x);
	Data[i]<<=x;
	tme[i]++;
}
void RSH(int i,int x){
	if(!debug) printf("RSH %d %d\n",i,x);
	Data[i]>>=x;
	tme[i]++;
}


int cnt;

int G[64],P[64],S[64],tmp=400;
int adder(int x,int y){
	for(int i=0;i<64;i++){
		G[i]=++cnt;
		AND(G[i],x,y);
		
		LSH(G[i],i);
	}
	for(int i=0;i<64;i++){
		P[i]=++cnt;
		XOR(P[i],x,y);
		
		LSH(P[i],i);
	}
	
	for(int t=0;t<6;t++){
		for(int i=0;i<64-(1<<t);i++){
			AND(tmp,G[i+(1<<t)],P[i]);
			OR(G[i],G[i],tmp);
			
			AND(P[i],P[i],P[i+(1<<t)]);
		}
	}
	XOR(1,x,y);
	XOR(1,1,G[1]);
	
	return 1;
}

int A[64],B[64];


int f[2][64],siz[2],id;
void trans(int x,int y,int z,int s,int c){
	XOR(s,x,y);
	XOR(s,s,z);
	
	OR(c,x,y);
	AND(c,c,z);
	AND(x,x,y);
	OR(c,c,x);
	
	LSH(c,1);
}

int main(){
//	cin>>Data[1]>>Data[2];
//	cout<<Data[1]*Data[2]<<'\n';
	return 0;
	cnt=2;
	for(int i=0;i<64;i++) B[i]=++cnt;
	
	int sav=cnt;
	for(int i=0;i<64;i++){
		cnt=sav;
		for(int j=0;j<64;j++){
			A[j]=++cnt;
			SET(A[j],2);
			LSH(A[j],63-i);
			RSH(A[j],63);
			LSH(A[j],j);
		}
		for(int t=0;t<6;t++){
			for(int j=0;j+(1<<t)<64;j+=(1<<t)){
				OR(A[j],A[j],A[j+(1<<t)]);
			}
		}
		AND(B[i],A[0],1);
		LSH(B[i],i);
	}
	cnt=sav;
//	cout<<"B: "; for(int i=0;i<64;i++) cout<<Data[B[i]]<<" "; cout<<'\n';
	
	for(int i=0;i<64;i++) f[0][i+1]=B[i];
	siz[0]=64;
	
	while(siz[id]>2){
		id^=1;
		siz[id]=0;
		for(int t=1;t<=siz[id^1]%3;t++){
			f[id][++siz[id]]=f[id^1][t];
		}
		for(int t=siz[id^1]%3+1;t<=siz[id^1];t+=3){
			f[id][++siz[id]]=++cnt;
			f[id][++siz[id]]=++cnt;
			trans(f[id^1][t],f[id^1][t+1],f[id^1][t+2],cnt-1,cnt);
		}
//		for(int i=1;i<=siz[id];i++) cout<<Data[f[id][i]]<<" ";
//		cout<<'\n';
	}
	
	int tot=adder(f[id][1],f[id][2]);
//	cout<<Data[tot]<<'\n';
	
//	int mx=0; 
//	for(int i=1;i<=cnt;i++) mx=max(mx,tme[i]);
//	cout<<cnt<<" "<<mx;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3304kb

input:

main

output:


result:

wrong answer Wrong Answer on test 1: a[1]=2839929338295232408, a[2]=10943642511305433214, but found 2839929338295232408