Codeforces Round #165 (Div. 2)
はい。
http://codeforces.com/contest/270
A. Fancy Fence
ざっくりと大意
・農場の囲いをロボットに作らせるのに多角形になる角度か??
方針のようなもの
・決まった角度でしか構成されないなら正多角形になる
・正多角形であるかどうかの判定は外角の和が360°になるか?らしい??
for i in xrange(input()): print 'YES' if 360%(180-int(raw_input()))==0 else 'NO'
#include<iostream> #include<cmath> #include<string> #include<cctype> #include<vector> #include<algorithm> using namespace std; int main(){ int n; scanf("%d",&n); for(int i=0;i<n;i++){ int x; scanf("%d",&x); if(360%(180-x)){ printf("NO\n"); }else{ printf("YES\n"); } } return 0; }
C++練習してみてるけど色々やりにくい・・・