Gym - 101670C Chessboard Dancing(CTU Open Contest 2017 找规律)
题目:链接
思路:
多画出几个情况就可以找出规律来了
Knight (当大于2的时候只要两种颜色相间出现就可以了)



King(当大于等于3的时候,总可以用四种形式来补色,具体如下)



Bishop(斜率为一的斜着的一行要不能相同,那只能是一列一个颜色了)



Rook(要想水平竖直的颜色不一样,那只能是斜着的一行的颜色是一样的)



代码:
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 1e3+; int main() {
int temp;
char op;
while(scanf("%d %c",&temp,&op)!=EOF) {
if(temp==) {
printf("1\n");
continue;
} else {
if(op=='N') {
if(temp==)
printf("1\n");
else
printf("2\n");
}
else if(op=='K'){
printf("4\n");
}
else if(op=='B' || op=='R'){
printf("%d\n",temp);
}
}
}
return ;
}
/*
PutIn:
2 N
8 R
2 B
1 K
PutOut:
1
8
2
1
*/
Gym - 101670C Chessboard Dancing(CTU Open Contest 2017 找规律)的更多相关文章
- Gym - 101670H Go Northwest!(CTU Open Contest 2017 思维题+map)
题目: Go Northwest! is a game usually played in the park main hall when occasional rainy weather disco ...
- Gym - 101670A Amusement Anticipation(CTU Open Contest 2017 签到题)
题目&题意: 倒着找处于最后位置的等差数列的开头的位置. 例: 1 5 3 4 5 6 3 4 5 6是等差数列,它的开头的位置是3 PS: 读题真的很重要!!!!多组输入,上来就读错了!! ...
- Gym - 101670F Shooting Gallery(CTU Open Contest 2017 区间dp)
题目&题意:(有点难读...) 给出一个数字序列,找出一个区间,当删除这个区间中的两个相同的数字后,只保留这两个数字之间的序列,然后继续删除相同的数字,问最多可以实行多少次删除操作. 例如: ...
- Gym - 101670G Ice cream samples(CTU Open Contest 2017 尺取法)
题目: To encourage visitors active movement among the attractions, a circular path with ice cream stan ...
- Gym - 101670E Forest Picture (CTU Open Contest 2017 模拟)
题目: https://cn.vjudge.net/problem/1451310/origin 题意&思路: 纯粹模拟. 大体题意是这样的: 1.有人要在一个10-9<=x<=1 ...
- Gym - 101670H Dark Ride with Monsters(CTU Open Contest 2017 贪心)
题目: A narrow gauge train drives the visitors through the sequence of chambers in the Dark Ride attra ...
- Gym - 101670B Pond Cascade(CTU Open Contest 2017 贪心,二分)
题目: The cascade of water slides has been installed in the park recently and it has to be tested. The ...
- Gym - 101670J Punching Power(CTU Open Contest 2017 最大独立集)
题目: The park management finally decided to install some popular boxing machines at various strategic ...
- CTU Open Contest 2017
这场题很水.水题我就懒得贴了. B - Pond Cascade 优先队列维护这个水池需要多少时间 或者 直接扫一遍. #include <cstdio> #include <cst ...
随机推荐
- 扩展欧几里得模板&逆元求法
拓展欧几里得: 当 gcd ( a , b )= d 时,求绝对值和最小的 x , y 使得 x * a + y * b = d : d = gcd ( a , b ) = gcd ( b , a m ...
- C语言8大经典排序算法(2)
二.插入类排序 插入排序(Insertion Sort)的基本思想是:每次将一个待排序的记录,按其关键字大小插入到前面已经排好序的子文件中的适当位置,直到全部记录插入完成为止. 插入排序一般意义上有两 ...
- YTU 2506: 切面条
2506: 切面条 时间限制: 1 Sec 内存限制: 128 MB 提交: 382 解决: 223 题目描述 一根高筋拉面,中间切一刀,可以得到2根面条. 如果先对折1次,中间切一刀, ...
- 转 source insight 复制后光标在前面
source insight 里编辑的时候,每次粘贴后,光标停留在粘贴内容的前面. 我想把它设定为 粘贴后,光标移动倒粘贴内容的后面. 怎么做? 这是个设置问题,按照下面的步骤设定就可以了. Opti ...
- python 之filter()函数
filter()函数是 Python 内置的另一个有用的高阶函数,filter()函数接收一个函数 f 和一个list,这个函数 f 的作用是对每个元素进行判断,返回 True或 False,filt ...
- KVPhone,VOS官方的SIP软电话电脑客户端
来自官方,品质纯正.但是可能因为JAVA环境等问题无法安装,可以试试! 下载地址: 解压密码:www.51voip.org
- 栗染-Error parsing D:\sdkforas\android-sdk-windows\system-images\android-24\android-wear\x86\devices.xml
每次打开android virtual device manager 下面都会出现这样的问题 解决办法: 打开自己安装的sdk目录,找到/tools/lib/devices.xml去替换图中路径里面的 ...
- selenium对51job进行职位爬虫
selenium 爬虫流程如下: 1.对某职位进行爬虫 ---如:自动化测试 2.用到IDE为 pycharm 3.爬虫职位导入到MongoDB数据库中 4.在线安装 pip install pymo ...
- Lightoj 1020 - A Childhood Game (博弈)
题目链接: 1020 - A Childhood Game 题目描述: Alice和Bob在玩弹珠游戏,两人轮流拿走弹珠,每次只能拿走一个或者两个,当Alice作为先手时谁拿走最后一个就是输家,而Bo ...
- 递推DP UVA 1424 Salesmen
题目传送门 /* 题意:给定包含n个点的无向图和一个长度为L的序列,修改尽量少的点使得相邻的数字相同或连通 DP:状态转移方程:dp[i][j] = min (dp[i][j], dp[i-1][k] ...