比赛 ctime蒟蒻生日赛 评测结果 AAAAAAAAAA
题目名称 守望者的逃离 最终得分 100
用户昵称 하루Kiev 运行时间 0.004 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2017-10-17 18:39:08
显示代码纯文本
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
using namespace std;
void panduan();
int m,s,t;
int m1,t1,s1;
int main()
{
    freopen("escape.in","r",stdin);
    freopen("escape.out","w",stdout);
    cin>>m>>s>>t;
    m1=m,t1=t,s1=s;
    while(m1>=10)
    {
       m1-=10;
       t1--;
       s1-=60;
       if(s1<=0)
       {  
         cout<<"Yes"<<endl<<t-t1;
         //while(1);
         return 0;
       }
       if(t1==0)
       {
         cout<<"No"<<endl<<s-s1;
         //while(1);
         return 0;
       }
    }
    panduan();
    //while(1);
   //fclose(stdin);
   //fclose(stdout);
   return 0;
}   
void panduan()
{    
    int ne=10-m1,tj;
    if(ne%4==0) tj=ne/4;
    else  tj=ne/4+1;
    if(s1/17<tj+1||t1<tj+1)
    {
       for(t1;t1>=1;t1--)
       {
           s1-=17;
           if(s1<=0)
           {
             cout<<"Yes"<<endl<<t-t1+1;
             //while(1);
             return;
           }
       }
       cout<<"No"<<endl<<s-s1;
      // while(1);
       return;
    }
    else
    {
        t1=t1-tj-1;
        m1=tj*4+m1-10;
        s1-=60;
        panduan();
    }
               
}