hdu - 1029 -Ignatius and the Princess IV
2014-12-27 20:14
302 查看
今天写题目突然想起来这个小技巧,哈哈哈哈呵呵,忘记是哪一题狂找找出来了。。。
#include<stdio.h> int main() { long n,num,cnt,res; while(~scanf("%d",&n)) { cnt = 0; while(n--) { scanf("%d",&num); if(0 == cnt) { res = num; cnt++; } else { if(res == num) cnt++; else cnt--; } } printf("%d\n",res); } return 0; }
相关文章推荐
- hdu 1029 ( Ignatius and the Princess IV ) 水题
- HDU 1029 Ignatius and the Princess IV - Problem A
- hdu 1029 Ignatius and the Princess IV(水题,map)
- hdu 1029 Ignatius and the Princess IV
- [ACM] hdu 1029 Ignatius and the Princess IV (动归或hash)
- hdu 1029 Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV
- HDU--1029--Ignatius and the Princess IV
- HDU—— 1029 Ignatius and the Princess IV
- hdu-oj 1029 Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV
- Hdu 1029 Ignatius and the Princess IV (鸽巢原理)
- HDU 1029 Ignatius and the Princess IV
- hdu 1029 Ignatius and the Princess IV
- hdu 1029 Ignatius and the Princess IV(快排)
- hdu 1029 Ignatius and the Princess IV
- HDU 1029 Ignatius and the Princess IV
- HDU1029——Ignatius and the Princess IV
- Ignatius and the Princess IV hdu 1029