60pts WA on line 20,column 476854 求调
查看原帖
60pts WA on line 20,column 476854 求调
764239
ABCgfed楼主2023/8/24 09:23

评测记录

#include<iostream>
using namespace std;
int map[200050]={0};
int num[200050]={0};
int his[200050]={0};
int mod(int a,int b){
	if(a>0){
		return a%b;
	}
	else{
		long long res=a+3000000000;
		return (res)%b;
	}
}
int main(){
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		int inp;
		int ifzero=0;
		cin>>inp;
		for(int j=0;j<200000;j++){
 			map[j]=0;
			num[j]=0;
			his[j]=0;
		}
		for(int j=0;j<inp;j++){
			int x;
			cin>>x;
			his[j]=x;
			if(x==0){
				if(ifzero==0){
					ifzero=1;
					map[j]=1;
					continue;
				}
				else{
					continue;
				}
			}
			if(num[mod(mod(x,99414377),173139)]==0){
				num[mod(mod(x,99414377),173139)]=x;
				map[j]=1;
			}
			else{
				num[mod(mod(x,99414377),173139)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(mod(x,89414377),196397)]==0){
				num[mod(mod(x,89414377),196397)]=x;
				map[j]=1;
			}
			else{
				num[mod(mod(x,89414377),196397)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(x,198970)]==0){
				num[mod(x,198970)]=x;
				map[j]=1;
			}
			else{
				num[mod(x,198970)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(x,198997)]==0){
				num[mod(x,198997)]=x;
				map[j]=1;
			}
			else{
				num[mod(x,198997)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(x,199999)]==0){
				num[mod(x,199999)]=x;
				map[j]=1;
			}
			else{
				num[mod(x,199999)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(x,169999)]==0){
				num[mod(x,169999)]=x;
				map[j]=1;
			}
			else{
				num[mod(x,169999)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(x,169969)]==0){
				num[mod(x,169969)]=x;
				map[j]=1;
			}
			else{
				num[mod(x,169969)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(mod(x,69414377),179989)]==0){
				num[mod(mod(x,69414377),179989)]=x;
				map[j]=1;
			}
			else{
				num[mod(mod(x,69414377),179989)]=x;
			}
		}
		for(int j=0;j<200050;j++){
			num[j]=0;
		}
		for(int j=0;j<=inp;j++){
			int x=his[j];
			if(x==0){
				continue;
			}
			if(num[mod(x,179989)]==0){
				num[mod(x,179989)]=x;
				map[j]=1;
			}
			else{
				num[mod(x,179989)]=x;
			}
		}
		for(int j=0;j<inp;j++){
			if(map[j]==1){
				cout<<his[j]<<" ";
			}
		}
		cout<<endl;
	}
	return 0;
}
2023/8/24 09:23
加载中...