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 ...
随机推荐
- Hibernate - Query简易
package cn.demo; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; im ...
- 2015-2016 ACM-ICPC Pacific Northwest Regional Contest (Div. 2) S Surf
SurfNow that you've come to Florida and taken up surng, you love it! Of course, you've realized that ...
- [LeetCode] Construct Binary Tree from Inorder and Pretorder Traversal
Given preorder and inorder traversal of a tree, construct the binary tree. Note:You may assume that ...
- luogu 3958 奶酪
noip2017 D2T1 奶酪 某zz选手没有想到可以用并查集来做,直接用了dijskstra,结果被ccf老爷机卡成了70分 题目大意: 现有一块大奶酪,它的高度为 h,它的长度和宽度我们可以认为 ...
- CentOS下实现Flask + Virtualenv + uWSGI + Nginx部署
一.项目简介 在本文中,将一步一步搭建一个简单的Flask + Virtualenv + uWSGI + Nginx 架构的Web服务,可以作为新手的学习也可作为记录备忘. 如果你安装好了环境并有一定 ...
- GCD中各种队列和任务执行方式的组合
一.概念回顾 1.GCD全称 Grand Central Dispatch ,是纯C语言,提供了非常多强大的函数,来进行系统线程的管理. 2.优势:GCD是苹果公司为多核的并行运算提出的解决方案.GC ...
- 基于Linux系统的Shell编程-基础篇
1. Shell基础介绍 1.1 Shell编程的意义 为什么使用shell编程 节约时间 1.2 显示脚本执行过程 前面有+表示执行过的命令的 前面没有东西,表示输出到屏幕上的内容. [root@C ...
- redis 缓存应用
第1章 部署与安装 wget http://download.redis.io/releases/redis-3.2.10.tar.gz tar xf redis-3.2.10.tar.gz cd r ...
- 2017青岛网络赛1011 A Cubic number and A Cubic Number
A Cubic number and A Cubic Number Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 65535/3276 ...
- WebSphere设置会话超时时间
WebSphere Application Server的会话超时时间可以在三个层面进行设置,分别为:应用程序服务器级别.应用程序级别和代码层面进行设置. 设置方式:应用程序级别级别和应用级别可以通过 ...