URAL
来源:互联网 发布:怎么改变网络节点 编辑:程序博客网 时间:2024/04/28 09:33
题目http://acm.timus.ru/problem.aspx?space=1&num=2068
题目大体意思就是说有两个人要将奇数堆的坚果分成三堆都含有奇数个的坚果堆,直到一方没法分为止....对于每一堆坚果都可以看成含有2*k+1个坚果,
由于到最后都会被分成只有一个坚果的坚果堆,那么含有2*k+1个的坚果就可以被k次,那么只需要判断被分的次数是奇还是偶就可以了
#include<stdio.h>#include<string.h>#include<stdlib.h>int main(){int n,m,sum=0;scanf("%d",&m);while(m--){scanf("%d",&n);if(n!=1) sum+=n/2;}if(sum%2==1) printf("Daenerys\n");else printf("Stannis\n");return 0;}
0 0
- URAL
- 【ural】
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- URAL
- Linux 一 Linux系统入门及获取帮助
- 有关于数组
- 常用Linux命令、包括vi 、svn
- PHP获取文件的绝对路径
- Python列表、元组
- URAL
- codeigniter 去除index.php (nginx,apache) 通用方法
- 凭兴趣求职80%会失败,为什么
- hiho1040 矩形判断
- 单链表
- poj2833(优先队列)
- Android Notification的各种Style, 一句链式调用就搞定。
- 无尺度网络的鲁棒性和脆弱(小世界网络)
- 杂谈篇-nginx(tengine)+lua动态后端实现,无间断扩容缩容