St1why 30pts luogu
  • 板块灌水区
  • 楼主Wildchesse
  • 当前回复0
  • 已保存回复0
  • 发布时间2023/10/21 21:30
  • 上次更新2023/11/2 12:07:41
查看原帖
St1why 30pts luogu
362022
Wildchesse楼主2023/10/21 21:30
#include<bits/stdc++.h>
using namespace std;
const int MAXN=15;
long long n,ans,coop,one,a[MAXN][15],b[15],c[MAXN][15],mem[15][15];
int main(){
//	freopen("lock.in","r",stdin);
//	freopen("lock.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=5;j++){
			cin>>a[i][j];
		}
	}
	if(n==1){
		cout<<81<<endl;
		return 0;
	}
	else{
		for(int i=1;i<=n;i++){
			for(int j=2;j<=5;j++){
				c[i][j]=a[i][j]-a[i][j-1];
			}
		}
		for(int i=2;i<=n;i++){
			int flag=0;
			for(int j=2;j<=5;j++){
				if(a[i][j]!=a[i-1][j]){
					if(coop){
						if(j!=coop and j!=coop+1){
							cout<<ans<<endl;
							return 0;
						}
						else{
							continue;
						}
					}
					if(flag){
						if(flag==1){
							flag=2;
							continue;
						}
						else{
							cout<<ans<<endl;
							return 0;
						}
					}
					coop=j;
					flag=1;
				}
			}
		}
		if(coop==0){
			cout<<81<<endl;
			return 0;
		}
		bool flag2=false;
		for(int i=2;i<=n;i++){
			if(a[i][coop+1]!=a[i-1][coop+1]){
				flag2=true;
				break;
			}
		}
		if(!flag2){
			ans+=10;
		}
		flag2=false;
		if(coop==5){
			coop=4;
		}
		for(int i=1;i<=n;i++){
			int tmp=c[i][coop+1];
			flag2=false;
			for(int j=1;j<=10;j++){
				int k=j+tmp+10;
				int x=j%10;
				int y=k%10;
				mem[x][y]++;
			}
		}
		for(int i=0;i<=9;i++){
			for(int j=0;j<=9;j++){
				if(mem[i][j]==n){
					ans++;
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}


2023/10/21 21:30
加载中...