题目:链接

思路:

多画出几个情况就可以找出规律来了

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 找规律)的更多相关文章

  1. 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 ...

  2. Gym - 101670A Amusement Anticipation(CTU Open Contest 2017 签到题)

    题目&题意: 倒着找处于最后位置的等差数列的开头的位置. 例: 1 5 3 4 5 6 3 4 5 6是等差数列,它的开头的位置是3 PS: 读题真的很重要!!!!多组输入,上来就读错了!! ...

  3. Gym - 101670F Shooting Gallery(CTU Open Contest 2017 区间dp)

    题目&题意:(有点难读...) 给出一个数字序列,找出一个区间,当删除这个区间中的两个相同的数字后,只保留这两个数字之间的序列,然后继续删除相同的数字,问最多可以实行多少次删除操作. 例如: ...

  4. Gym - 101670G Ice cream samples(CTU Open Contest 2017 尺取法)

    题目: To encourage visitors active movement among the attractions, a circular path with ice cream stan ...

  5. Gym - 101670E Forest Picture (CTU Open Contest 2017 模拟)

    题目: https://cn.vjudge.net/problem/1451310/origin 题意&思路: 纯粹模拟. 大体题意是这样的: 1.有人要在一个10-9<=x<=1 ...

  6. 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 ...

  7. 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 ...

  8. Gym - 101670J Punching Power(CTU Open Contest 2017 最大独立集)

    题目: The park management finally decided to install some popular boxing machines at various strategic ...

  9. CTU Open Contest 2017

    这场题很水.水题我就懒得贴了. B - Pond Cascade 优先队列维护这个水池需要多少时间 或者 直接扫一遍. #include <cstdio> #include <cst ...

随机推荐

  1. zabbix 监控zookeeper

    1.监控脚本如下:check_zookeeper.sh 1 2 #!/bin/bash echo mntr | nc 127.0.0.1 2182 | grep "$1" |awk ...

  2. golang中管道热替换

    golang中管道替换问题 https://blog.csdn.net/cyk2396/article/details/78875347 1.运行以下代码: var chan1 chan int va ...

  3. 【USACO 2010FEB】 slowdown

    [题目链接] 点击打开链接 [算法] dfs序 + 线段树 树链剖分同样可以解决这个问题 [代码] #include<bits/stdc++.h> using namespace std; ...

  4. is not mapped [from错误

    我出现的错误是:org.hibernate.hql.ast.QuerySyntaxException: loginuser is not mapped [from loginuser] 配置文件如下: ...

  5. 最常用的~正则表达式-相关js函数知识简洁分享【新手推荐】

    一.正则表达式的创建 JS正则的创建有两种方式: new RegExp() 和 直接字面量. //使用RegExp对象创建 varregObj =newRegExp("(^\s+)|(\s+ ...

  6. bzoj 2015: [Usaco2010 Feb]Chocolate Giving【spfa】

    因为是双向边,所以相当于两条到1的最短路和,先跑spfa然后直接处理询问即可 #include<iostream> #include<cstdio> #include<q ...

  7. bzoj 1707: [Usaco2007 Nov]tanning分配防晒霜【贪心||最大流(?)】

    洛谷上能过的最大流bzoj上T了--但是贪心做法明明在洛谷上比最大流要慢啊--如果是最大流的话就是裸题了吧 说一下贪心,就按照防晒霜排序,然后对每一个防晒霜选一头可以使用的且r最小的牛 就,没了. 贪 ...

  8. 给独立搭建的博客启用https的过程

    申请SSL证书 我自己独立搭建的博客部署在阿里云服务器上,因此我就先搜索阿里云启用https的方法,网上有比较详细的讲解,在此提供一个参考网址: https://blog.csdn.net/csluc ...

  9. (快排)51NOD 1018 排序

    给出N个整数,对着N个整数进行排序   Input 第1行:整数的数量N(1 <= N <= 50000) 第2 - N + 1行:待排序的整数(-10^9 <= A[i] < ...

  10. HDU 1879(最小生成树)

    #include "iostream" #include "algorithm" #include "cstdio" using names ...