0pts TLE 求助
  • 板块P10457 占卜DIY
  • 楼主C_Boa
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/6/30 16:25
  • 上次更新2024/6/30 16:37:11
查看原帖
0pts TLE 求助
1022472
C_Boa楼主2024/6/30 16:25
#include<bits/stdc++.h>
using namespace std;
deque<int> d[15];
char c;
int a[60],b=0;
int main(){
	for(int i=1;i<=13;i++){
		for(int j=1;j<=4;j++){
			cin>>c;
			if(c=='A') d[i].push_back(1);
			else if(c=='0') d[i].push_back(10);
			else if(c=='J') d[i].push_back(11);
			else if(c=='Q') d[i].push_back(12);
			else if(c=='K') d[i].push_back(13);
			else d[i].push_back(c-'0');
		}
	}	
		while(!d[13].empty()){
			int x=d[13].front();
			d[x].pop_front();
			while(1+1==2){
				if(x==13){
					break;
				}
				d[x].push_front(x);
				a[x]++;
				if(a[x]==4){
					b++;
				}
				int y=d[x].back();
				d[x].pop_back();
				x=y;
			}
		}
	cout<<b;
	return 0;
}

2024/6/30 16:25
加载中...