HDU 5660/BC 79A jrMz and angles
来源:互联网 发布:asp sql防注入代码 编辑:程序博客网 时间:2024/06/06 03:12
正n边形的内角度数为 (n-2)/n*180 所以可以设取a个n角b个m角(a,b≤6)枚举ab即可
#include<cstdio>#include<cstdlib>#include<cstring>#include<cmath>#include<iostream>#include<algorithm>#include<vector>#include<list>#include<set>#include<map>#include<stack>#include<queue>#include<deque>#define mem(x,y) memset(x,y,sizeof(x))#define pb push_backusing namespace std;typedef long long ll;typedef unsigned long long ull;typedef pair<ll,ll> pii;#define bug puts("===========");const double pi=(acos(-1.0));const double eps=1e-8;const ll INF=1e18+10;const ll inf=1e14;const int maxn=1000+10;const int mod=100000007;/*===============================*/bool go(int n,int m){ for(int a=0;a<=10;a++){ if(2*a%n==0&&a-2*a/n==2) return 1; if(2*a%m==0&&a-2*a/m==2) return 1; for(int b=0;b<=10;b++){ int z=2*a*m+2*b*n; if(z%(n*m)==0&&a+b-z/n/m==2) return 1; } } return 0;}int main(){ int T_T,n,m; scanf("%d",&T_T); while(T_T--){ scanf("%d%d",&n,&m); if(go(n,m)) puts("Yes"); else puts("No"); } return 0;}
0 0
- HDU 5660/BC 79A jrMz and angles
- BC-水题 jrMz and angles
- BC之jrMz and angles
- HDU jrmz and angles
- BestCoder Round #79 1001/hdu 5660 jrMz and angles
- 【HDU 5660】【水题】jrMz and angles
- hdu 5660 jrMz and angles(水题)
- hdu 5660 jrMz and angles【暴力枚举】【水题】
- 【杭电】[5660]jrMz and angles
- 杭电5660 jrMz and angles
- jrMz and angles
- jrMz and angles
- jrMz and angles
- jrMz and angles 暴力
- HDU 5560 jrMz and angles(简单暴力枚举)
- bestcoder Round #79 (div.2)jrMz and angles
- BestCoder Round #79 (div.2)-jrMz and angles,,暴力求解~
- HDU 4981/BC 6A Goffi and Median
- UITableViewCell
- Spark入门学习交流—编程模型及SparkShell实战
- docker(4):coreos+docker+rancher真厉害
- 同样的错误不能犯两次(八):恐惧心理
- c++ json封装---解析
- HDU 5660/BC 79A jrMz and angles
- 解决安装vs 后,L2TP VPN连接789错误的问题
- 几种经典的网络服务器架构模型的分析与比较
- redis这些内存消耗数据怎么看呢,主要看哪个说明内存比较大了?
- PHP正则表达式
- 初学android开发--day06
- Spring AOP动态代理原理与实现方式
- Oracle-20-is null使用&order by子句
- Camera AIDL - BpCamera,AIDL