codeforces—— 270A —— Fancy Fence
来源:互联网 发布:sql积分表设计 编辑:程序博客网 时间:2024/06/17 18:56
Emuskald needs a fence around his farm, but he is too lazy to build it himself. So he purchased a fence-building robot.
He wants the fence to be a regular polygon. The robot builds the fence along a single path, but it can only make fence corners at a single angle a.
Will the robot be able to build the fence Emuskald wants? In other words, is there a regular polygon which angles are equal to a?
The first line of input contains an integer t (0 < t < 180) — the number of tests. Each of the following t lines contains a single integer a(0 < a < 180) — the angle the robot can make corners at measured in degrees.
For each test, output on a single line "YES" (without quotes), if the robot can build a fence Emuskald wants, and "NO" (without quotes), if it is impossible.
3306090
NOYESYES
In the first test case, it is impossible to build the fence, since there is no regular polygon with angle .
In the second test case, the fence is a regular triangle, and in the last test case — a square.
问所给值是否是多边形内角。水题
#include<iostream>#include<cstdio>#include<cstring>#include<cmath>#include<algorithm>using namespace std;int main(){ int N,n; cin>>N; while(N--) { cin>>n; if((360.0/(180-n))-(360/(180-n))==0) cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0;}
- codeforces—— 270A —— Fancy Fence
- Codeforces 270A - Fancy Fence
- codeforces 270A Fancy Fence
- codeforces 270A Fancy Fence
- A. Fancy Fence
- codeforces——677A——Vanya and Fence
- Fancy Fence
- poj——A decorative fence
- <React: Up and Running>阅读笔记 — The life of a component & Excel: a fancy table component
- Codeforces Round #256 (Div. 2)——Painting Fence
- Thrust快速入门教程(四) —— Fancy Iterators
- Poj3253—Fence Repair
- poj3253——Fence Repair
- POJ3253——Fence Repair
- POJ3253——Fence Repair
- poj3253——Fence Repair
- android graphic(15)—fence
- 数据库技术就像陈年的酒,越老越香——记Fancy的数据库写意人生
- poj 2524-小白算法学习 并查集 Ubiquitous Religions
- IDEA里面创建maven项目,依赖
- 计算机网络基础知识
- Solr Suggest实现搜索智能提示
- TCP/IP, WebSocket 和 MQTT
- codeforces—— 270A —— Fancy Fence
- ios中定时器
- DL学习笔记【23】pytorch安装教程(超简单就两个命令)
- 进程间通信之消息队列
- Android_Handler
- GitHub 学习心得
- 这样讲TCP的恋爱和分手大家都懂了
- Building Fences Kattis
- java-io