URI ONLINE JUDGE SOLUTION 1300 - Online Judge

Latest

This is an Online Judge Solution Base Site. We can discuss & Solve any contest solution in Programming.

Friday, April 10, 2020

URI ONLINE JUDGE SOLUTION 1300

Problem Number: 1300
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..