Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:甩发代码,其实不是那么麻烦,代码多了点,直接模拟比较就可以了

Posted by 20223639 at 2024-04-02 16:55:54 on Problem 1676
In Reply To:甩发代码,其实不是那么麻烦,代码多了点,直接模拟比较就可以了 Posted by:kuaichenyang at 2015-11-19 14:43:14
> #include <stdio.h>
> #include <字符串.h>
>
> typedef struct tagDigit{
> int 数;
> 字符 d[3][4];
> tagDigit(){}
> tagDigit(int number,char d[3][4]){
>这个->number=number;
> for(int i=0;我<3;i++){
> for(int j=0;J<4;j++){
>这个->d[i][j]=d[i][j];
> }
> }
> }
> }digit;
>
> const int _MAXN=30;
> 数字 num[10];
>
>字符数字[3][_MAXN];
> int ans1,ans2,ans3,ans4;
>
> void init(){
> char tmp0[3][4]={“ _ ”,“| |”,“|_|”};
> num[0]=数字(0,tmp0);
> char tmp1[3][4]={“ ”,“ |”,“ |”};
> num[1]=数字(1,tmp1);
> char tmp2[3][4]={“ _ ”,“ _|”,“|_ ”};
> num[2]=数字(2,tmp2);
> char tmp3[3][4]={“ _ ”,“ _|”,“ _|”};
> num[3]=数字(3,tmp3);
> char tmp4[3][4]={“ ”,“|_|”,“ |”};
> Num[4]=数字(4,tmp4);
> char tmp5[3][4]={“ _ ”,“|_ ”,“ _|”};
> num[5]=数字(5,tmp5);
> char tmp6[3][4]={“ _ ”,“|_ ”,“|_|”};
> Num[6]=数字(6,tmp6);
> char tmp7[3][4]={“ _ ”,“ |”,“ |”};
> num[7]=数字(7,tmp7);
> char tmp8[3][4]={“ _ ”,“|_|”,“|_|”};
> num[8]=数字(8,tmp8);
> char tmp9[3][4]={“ _ ”,“|_|”,“ _|”};
> Num[9]=数字(9,tmp9);
> }
>
> 布尔法官(int g1,int g2,int g3,int g4,int flag){
> bool ok=true;
> int G[5]={0,g1,g2,g3,g4};
> int s=1;
> for(int L=(flag==1? 0:13);L<(flag==1? 10:23);L+=3,s++){
> for(int i=0;我<3;i++){
> for(int j=L;j<L+3;j++){
> if(Num[G[s]].d[i][j-L]==' '&&digit[i][j]!=' '){
> ok=false;
>转到 F;
> }
> }
> }
> }
> F:;
>返回正常;
> }
>
> int main(){
> init();
> int N;
> for(scanf(“%d”,&N),getchar();N--;){
> //扫一扫
> for(int i=0;我<3;i++){
> gets(digit[i]);
> }
> ans1=ans2=ans3=ans4=0;
>
> //工作
> int sum=0;
> for(int L1=0;L1<3;L1++){
> int top=L1==2?4:10;
> for(int L2=0;L2<顶部;L2++){
> for(int L3=0;L3<6;L3++){
> for(int L4=0;L4<10级;L4++){
> int timeNow=(L1*10+L2)*60+L3*10+L4;
> int timePre=(timeNow-15+1440)%1440;
> int l1,l2,l3,l4;
> int t1=timePre/60;
> int t2=timePre%60;
>
> l1=t1/10;
> l2=t1%10;
> l3=t2/10;
> l4=t2%10;
> if(true==judge(L1,L2,L3,L4,1)&&true==judge(l1,l2,l3,l4,2)){
>和++;
> if(sum>1){
>转到 E;
> }
> ans1=L1,ans2=L2,ans3=L3,ans4=L4;
> }
> }
> }
> }
> }
> E:;
> if(sum>1){
> puts(“不确定”);
> }else{
> printf(“%d%d%d%d\n”,ans1,ans2,ans3,ans4);
> }
> }
>返回 0;
> } 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator