Friday, July 22, 2016

UVA 12531 Solution

Unknown
#include<cstdio>
#include<cmath>
using namespace std;
int main()
{
 int angle,mark[200]={0};
 for (int i=0;i<12;i++)
 {
  for (int j=0;j<60;j++)
  {
   angle=abs(j-(i+j/12))*6;
   if (angle>180) angle=360-angle;
   mark[angle]=1;
  }
 }
 int n;
 while (scanf("%d",&n)!=EOF)
 {
  if (mark[n]) printf("Y\n");
  else printf("N\n");
 }
 return 0;
}

Unknown

Studying at Shahjalal University of Science and Technology, Sylhet.

0 comments:

Post a Comment

Coprights @ 2016,