HDU4768
来源:互联网 发布:java安卓 编辑:程序博客网 时间:2024/06/11 13:07
思路:
1.a异或b再异或b 又变回a 同初学者那道奇偶性的题
2.算出哪个人只收到奇数的传单之后 再算他收到传单的次数
计算方法为看这个人是不是在[a[i],b[i]]内,再看是不是里面的数
/*Code By Aquariuslt*//*HDU 4768 Flyer*/#include<iostream>#include<stdio.h>#include<string>#include<algorithm>#include<string.h>#include<set>#include<vector>#include<queue>#include<stack>#include<limits.h>#include<math.h>#define FOR(i,a,b) for(int i=(a);i<(b);i++)#define FORD(i,a,b) for(int i=(a);i<=(b);i++)#define REP(i,b) FOR(i,0,b)#define CLR(a) memset(a,0,sizeof(a))using namespace std;#define maxn 20010int a[maxn],b[maxn],c[maxn];int main(){ int t; while(~scanf("%d",&t)){ int op=0,opn=0; REP(i,t){ scanf("%d %d %d",&a[i],&b[i],&c[i]); for(int st=a[i];st<=b[i];st+=c[i]){ op=op^st; } } REP(i,t){ if(op>=a[i]&&op<=b[i]&&(op-a[i])%c[i]==0)opn++; } if(opn%2==0)printf("DC Qiang is unhappy.\n"); else printf("%d %d\n",op,opn); } return 0;}
- HDU4768
- HDU4768(二分)
- hdu4768 二分
- HDU4768 Flyer
- HDU4768:Flyer(二分)
- hdu4768(二分)
- Flyer(二分 HDU4768)
- HDU4768 Flyer 二分
- HDU4768:Flyer(二分)
- HDU4768:Flyer(二分)
- hdu4768(二分)
- hdu4768 非常规的二分
- HDU4768 Flyer 二分|异或的性质|暴力
- 2013 ACM/ICPC Asia Regional Changchun Online Problem J & hdu4768 Flyer(二分)
- java笔试题---如何跳出当前的多重嵌套循环
- 飞机是由塑料杆的飞鸽传书
- Django Meta内部类选项
- Linux下Markdown的安装及常用语法
- 1009_(2)
- HDU4768
- 一会儿花雨停了的飞鸽传书
- windows server 2008的安装
- 设计模式 - 单例模式
- 神奇的二进制
- 黑马程序员——类加载器
- 杭电 1269 迷宫城堡
- mq进阶
- 动态加载FBX文件