Result: Accepted
Time: 6ms
Memory: 1092kB
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
int main()
{
int sgxq,sgxs,sgfz,zgxq,zgxs,zgfz;
double sum=0;
scanf("%d %d %d %d %d %d", &sgxq,&sgxs,&sgfz,&zgxq,&zgxs,&zgfz);
if(zgxq<sgxq)
zgxq=zgxq+7;
sum = sum+(zgxq-sgxq)*24*60;
if(zgxs<sgxs)
sum= sum -24*60+(zgxs+24-sgxs)*60;
else
sum = sum +(zgxs-sgxs)*60;
if(zgfz<sgfz)
sum= sum -60+(zgfz+24-sgfz);
else
sum = sum +zgfz-sgfz;
if(sum<=(24*60))
printf("Y e s\n");
else
printf("N o\n");
return 0;
}