记录编号 |
321461 |
评测结果 |
AAAAAAAAAA |
题目名称 |
[Nescafé II] 防线 |
最终得分 |
100 |
用户昵称 |
AntiLeaf |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.963 s |
提交时间 |
2016-10-13 19:15:28 |
内存使用 |
2.58 MiB |
显示代码纯文本
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int maxn=200010;
int T,n,l[maxn],r[maxn],d[maxn],tmp,cnt;
int main(){
#define MINE
#ifdef MINE
freopen("defline.in","r",stdin);
freopen("defline.out","w",stdout);
#endif
scanf("%d",&T);
while(T--){
scanf("%d",&n);
tmp=cnt=0;
for(int i=1;i<=n;i++){
scanf("%d%d%d",&l[i],&r[i],&d[i]);
for(int j=l[i];j<=r[i];j+=d[i])tmp^=j;
}
if(!tmp)printf("There's no weakness.\n");
else{
printf("%d ",tmp);
for(int i=1;i<=n;i++)if(tmp>=l[i]&&tmp<=r[i]&&tmp%d[i]==l[i]%d[i])cnt++;
printf("%d\n",cnt);
}
}
#ifndef MINE
printf("\n-------------------------DONE-------------------------\n");
for(;;);
#endif
return 0;
}