HDU Just do it (找规律暴力)
来源:互联网 发布:杀敌算法百度云 编辑:程序博客网 时间:2024/05/29 13:32
题目链接
Just do it
分析
简单打一下表,我们会发现,在第
为 了方便后面的计算,我们简单的做一个变换,考虑什么时候
AC code
/*Problem : 6129 ( Just do it ) Judge Status : Accepted*RunId : 21750455 Language : G++ Author : zouzhitao*Code Render Status : Rendered By HDOJ G++ Code Render Version 0.01 Beta*/#include<bits/stdc++.h>#define pb push_back#define mp make_pair#define PI acos(-1)#define fi first#define se second#define INF 0x3f3f3f3f#define INF64 0x3f3f3f3f3f3f3f3f#define random(a,b) ((a)+rand()%((b)-(a)+1))#define ms(x,v) memset((x),(v),sizeof(x))#define scint(x) scanf("%d",&x );#define scf(x) scanf("%lf",&x );#define eps 1e-10#define dcmp(x) (fabs(x) < eps? 0:((x) <0?-1:1))#define lc o<<1#define rc o<<1|1using namespace std;typedef long long LL;typedef long double DB;typedef pair<LL,LL> Pair;const int maxn = 2e5+10;int a[maxn];int b[maxn];int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int T; cin>>T; while (T--) { int n,m; cin>>n>>m; ms(b,0); m--; for(int i=1 ; i<=n ; ++i )cin>>a[i]; memcpy(b,a,sizeof(a)); for(int i=1 ; i<=n ; ++i){ int x = i+m; //std::cout << x<<" "<<m << '\n'; if((x & m) == m){ for(int j=i+1 ; j<=n ; ++j)b[j]^=a[j-i]; } } std::cout << b[1]; for(int i=2 ; i<=n ; ++i) std::cout << ' '<<b[i]; std::cout << '\n'; } return 0;}
阅读全文
0 0
- HDU Just do it (找规律暴力)
- hdu 6129 Just do it(找规律)
- HDU 6129 Just do it(找规律+杨辉三角)
- hdu 6129 Just do it (找规律)
- HDU6129 Just do it (找规律)
- hdu Just do it 组合数规律
- HDU 6129 Just do it(规律)
- hdu 6129 Just do it -规律
- HDU6129 Just do it【规律】
- Hdu 6129 Just do it【杨辉三角、规律】
- hdu 6129 Just do it (规律递推)
- HDU-Just do it
- 解题报告:HDU_6129 Just do it (找规律 两种做法)
- hdu 3189 Just Do It
- HDU 6129 Just do it
- HDU 6129 Just do it
- HDU 6129 Just do it
- HDU 6129Just do it
- 【Unity】unity 人物动态头像
- 【Java】Java绘图技术与事件处理机制
- 简约而不简单的Django教程
- HTML
- python读取excel
- HDU Just do it (找规律暴力)
- linux 正向代理反向代理
- __cxa_call_unexpected原因
- 对于自编译Ueditor问题
- 【Java实战】Java实现简易坦克对战小游戏
- javaseday21(缓冲区 为什么弄个int 和 char[] readLine 的实现原理 如何自己实现)
- js jq中$().eq()和$().find()的用法
- 2017 多校系列 5
- 假设检验与参数估计的R语言实现