WA! 0!
查看原帖
WA! 0!
648721
for_楼主2023/2/3 16:18
#include<bits/stdc++.h>
#define pr printf
#define sc scanf
#define raed read
using namespace std;
long long read(){
    long long x=0,sgn=1;char ch=getchar();
    while(ch<'0' || ch>'9'){if(ch=='-')sgn=-1;ch=getchar();}
    while(ch>='0' && ch<='9'){x=(x<<3)+(x<<1)+(ch&15);ch=getchar();}
    return x*sgn;
}
void write(long long x){
 	if(x==0){putchar('0');return;}if(x<0){putchar('-');x=-x;}
	long long len=0;long long buf[15];while(x){buf[len++]=x%10;x/=10;}
 	for(int i=len-1;i>=0;i--)putchar(buf[i]+'0');
}
long long t,n,id,_2[100],answ;
string st,id2,x;
char ans[60],ch;
bool p;
int main(){
	_2[1]=1;
	for(int i=2;i<=60;i++){
		_2[i]=_2[i-1]*2;
		//cout<<_2[i]<<endl; 
	}
	t=read();
	n=read();
	cin>>st;
	while(t--){
		cin>>id2;
		cin>>x;
		answ=0;
		id=0;
		memset(ans,0,sizeof(ans));
		for(int i=0;i<n;i++){
			p=0;
			for(int j=1;j<=4;j++){
				cin>>ch;
				if(ch=='1'){ans[i]=64+j;p=1;}
				//cout<<ans[i]<<endl;
				//cout<<"!!!"<<endl;
			}
			if(!p)answ--;
		}
		for(int i=15;i>=0;i--){
			if(id2[i]=='1'){
				id+=_2[16-i];
				//cout<<i<<endl;
				//cout<<_2[16-i]<<endl;
				//cout<<id<<endl;
			}
		}
		if(id>=1&&id<=10000)cout<<"ID:"<<" "<<id<<endl;
		else{cout<<"Wrong ID"<<endl<<endl;continue;}
		if(x[1]==id2[15]&&(x=="10"||x=="01"))cout<<"Type Correct"<<endl;
		else cout<<"Type Incorrect"<<endl;
		for(int i=0;i<n;i++){
			if(ans[i]==st[i])answ++;
			//cout<<answ<<endl;
		}	
		pr("%.1f",100.0/n*answ);
		cout<<endl<<endl;
	}
	return 0;
}

查了一小时分钟

什么也没查出来

......

2023/2/3 16:18
加载中...