Problem Name: Hours and Minutes
Author’s Name: By Pablo Ariel Heiber, UBA Argentina
Timelimit: 1
Problem Category: AD-HOC
Problem Source: https://www.urionlinejudge.com.br/judge/en/problems/view/1300
Solution:
#include <stdio.h>int main(){
int g, i, j, angulo, test;
while(scanf("%d",&g) != EOF){
j = 0;
test = 0;
for(i = 0; i < 60; i++){
if(i%5 == 0) j++;
angulo = i*6 - j*6;
if(g == angulo || g == -angulo){
test = 1;
break;
}
}
if(test == 1) printf("Yn");
else printf("Nn");
}
return 0;
}

No comments:
Post a Comment
Thanks..