4148: [AMPPZ2014]Pillars
来源:互联网 发布:淘宝店铺首页店招尺寸 编辑:程序博客网 时间:2024/06/01 09:23
神TM是道构造题。。。
然后根据题目给出来的各种神奇的条件 你可以开心地随便构造。。
怎么说?先不理障碍 构造一条回路 比如这样
然后你再对于每个障碍 看看它卡在奇数列还是偶数列什么的。。做一些调整
自己推一下就好了。我就是自己推哒(所以我的代码有地方跟别人发出来不同嘿嘿嘿
#include<bits/stdc++.h>using namespace std;const int N=1002;inline int read(){ char ch=getchar(); int x=0,f=1; while(ch<'0'||ch>'9'){if(ch=='-')f=-1; ch=getchar();} while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0'; ch=getchar();} return x*f;}char a[N][N];int main(){ int n=read(),m=read(),p=read(),i,j,x,y; for(i=1;i<=n;++i)for(j=1;j<=m;++j) a[i][j]=i&1?'D':'G'; for(i=1;i<=n;++i){ if(i<n)a[i][1]='P'; if(i&1){if(i>1)a[i][2]='L';} else a[i][m]='L'; } for(i=0;i<p;++i){ x=read(),y=read(); if(x&1){ a[x+1][y-1]=a[x+2][y+3]='L'; a[x][y+2]=a[x+1][y+2]='P'; } else{ a[x+1][y+2]='L'; if(y==3)a[x][1]='G',a[x][2]='P',a[x+1][2]='D'; else a[x-1][y-1]=a[x][y-1]='P',a[x][y-2]='L'; } } puts("TAK"); x=1,y=1; for(i=0;i<n*m-4*p;++i){ putchar(a[x][y]); if(a[x][y]=='L')x--; else if(a[x][y]=='P')x++; else if(a[x][y]=='D')y--; else y++; } return 0;}
0 0
- 4148: [AMPPZ2014]Pillars
- 【AMPPZ2014】【BZOJ4148】Pillars
- Codeforces 474 E. Pillars
- CodeForces 474 E. Pillars
- 【CODEFORCES】 E. Pillars
- 【CF 474E】Pillars
- 【AMPPZ2014】【BZOJ4143】The Lawyer
- 【AMPPZ2014】【BZOJ4147】Euclidean Nim
- 【bzoj4143】[AMPPZ2014]The Lawyer
- 【bzoj4144】[AMPPZ2014]Petrol
- 【bzoj4146】 [AMPPZ2014]Divisors
- 【bzoj4152】[AMPPZ2014]The Captain
- 【bzoj4145】[AMPPZ2014]The Prices
- 【AMPPZ2014】【BZOJ4145】The Prices
- 【bzoj4147】 [AMPPZ2014]Euclidean Nim
- 【bzoj4149】[AMPPZ2014]Global Warming
- 【bzoj4151】 [AMPPZ2014]The Cave
- 【AMPPZ2014】【BZOJ4146】Divisors
- react-native视频
- ios开发之NSIndexSet
- 宅急送 项目第六天 定区管理
- React Native for Android 异常处理概览
- 欢迎大家访问我的个人网站
- 4148: [AMPPZ2014]Pillars
- 清除浮动
- Androd系统开发最佳学习实践
- 2017Google Codejam round1b Problem B. Stable Neigh-bors
- React Native打包代码解析与拆分Bundle做法
- 并查集
- 请求无效
- 商品展示
- CentOS下tar解压 gz解压 bz2等各种解压文件使用方法