HDU 5512 Pagodas
2015-11-05 12:34
561 查看
2015 ACM / ICPC 沈阳现场赛 D 题
找了一小时规律......发现是个GCD。
找了一小时规律......发现是个GCD。
#include<cstdio> #include<cstring> #include<cmath> #include<queue> #include<algorithm> using namespace std; int n,a,b; int gcd(int a,int b) { int t; while(b) t = a%b,a = b,b = t; return a; } int main() { int T; scanf("%d",&T); for(int Case=1; Case<=T; Case++) { scanf("%d%d%d",&n,&a,&b); printf("Case #%d: ",Case); if((n/gcd(a,b)-2)%2==0) printf("Iaka\n"); else printf("Yuwgna\n"); } return 0; }
相关文章推荐
- google书签找回
- 数据签名标准算法-DSA (Digital signature Algorithm DSA)
- MTK6572 开机logo 和开机动画配置
- Django自带过滤器总结
- Algorithm Gossip: 得分排行
- Algorithm Gossip: 约瑟夫问题(Josephus Problem)
- Algorithm Gossip: 背包问题(Knapsack Problem)
- URAL 1534 Football in Gondor
- Go编译问题集锦
- View 的setVisibility有三个值:VISIBLE、INVISIBLE和GONE的区别
- Google 镜像站搜集
- good excel website
- 10月全球搜索引擎市场份额:Google、Bing份额大涨
- Microsoft Dynamics CRM2011 更换Logo
- Microsoft Dynamics CRM2011 更换Logo
- Microsoft Dynamics CRM2011 更换Logo
- Microsoft Dynamics CRM2011 更换Logo
- 开源浏览器引擎开发:Google 的人数是 Mozilla 的两倍
- aggragate mongo
- google play 924 错误