CF Round #426 (Div. 2) The Useless Toy 思维 水题
题目链接: http://codeforces.com/contest/834/problem/A
题目描述: 输入起始状态和结束状态和数列长度, 判断旋转方向是顺时针逆时针还是不合理
解题思路: 长度模4, 因为我们只关心起始和结尾, 然后判断
代码:
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <map> #include <iterator> using namespace std;map<char, char> CW; map<char, char> CCW; map<char, char>::iterator it; typedef long long ll; int main() {CW.insert(make_pair('^', '>'));CW.insert(make_pair('>', 'v'));CW.insert(make_pair('v', '<'));CW.insert(make_pair('<', '^'));for( it = CW.begin(); it != CW.end(); it++ ) {CCW.insert(make_pair(it->second, it->first));}char st, ed;ll dur;while( cin >> st >> ed ) {cin >> dur;dur %= 4;if( dur == 2 || dur == 0 ) {printf( "undefined\n" );}else {if( dur == 1 ) {if( CW[st] == ed ) {printf( "cw\n" );}else if( CCW[st] == ed ) {printf( "ccw\n" );}else {printf( "undefined\n" );}}else {if( CW[st] == ed ) {printf( "ccw\n" );}else if( CCW[st] == ed ) {printf( "cw\n" );}else {printf( "undefined\n" );}}}}return 0; }
View Code
思考: 没啥可说的, 水题
转载于:https://www.cnblogs.com/FriskyPuppy/p/7262201.html
CF Round #426 (Div. 2) The Useless Toy 思维 水题相关推荐
- Codeforces Round #370 (Div. 2) A. Memory and Crow 水题
A. Memory and Crow 题目连接: http://codeforces.com/contest/712/problem/A Description There are n integer ...
- Codeforces Round #311 (Div. 2) A. Ilya and Diplomas 水题
A. Ilya and Diplomas Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/ ...
- Codeforces Round #394 (Div. 2) A. Dasha and Stairs 水题
A. Dasha and Stairs 题目连接: http://codeforces.com/contest/761/problem/A Description On her way to prog ...
- Codeforces Round #404 (Div. 2) B. Anton and Classes 水题
B. Anton and Classes 题目连接: http://codeforces.com/contest/785/problem/B Description Anton likes to pl ...
- Codeforces Round #374 (Div. 2) A. One-dimensional Japanese Crosswor 水题
A. One-dimensional Japanese Crossword 题目连接: http://codeforces.com/contest/721/problem/A Description ...
- Codeforces Round #358 (Div. 2) A. Alyona and Numbers 水题
A. Alyona and Numbers 题目连接: http://www.codeforces.com/contest/682/problem/A Description After finish ...
- Codeforces Round #307 (Div. 2) A. GukiZ and Contest 水题
A. GukiZ and Contest Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/551/ ...
- Codeforces Round #311 (Div. 2)B. Pasha and Tea 水题
B. Pasha and Tea Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/557/prob ...
- Codeforces Round #350 (Div. 2) B. Game of Robots 水题
B. Game of Robots 题目连接: http://www.codeforces.com/contest/670/problem/B Description In late autumn e ...
最新文章
- 如何将自定义代码生成TVM
- 让Linux系统开机速度更快的方法
- 表达式类型的实现_程序员如何使代码简洁,Lambda表达式入门之四大引用(下篇)...
- SQL 注入工具集合
- 【Python基础】Python爬虫的两套解析方法和四种信息提取方式
- 车位预定查询html格式,停车场车位预定方法
- 一图看懂钉钉宜搭线上发布会
- IntelliJ IDEA for Mac在MacOS模式下的版本控制/本地历史记录快捷键(VCS and Local History Shortcut)
- 如何在win下使用linux命令
- mysql 多端口备份_mysql数据库迁移、多端口运行、innobackupex备份
- 《重构》阅读笔记-代码的坏味道
- Python实现十大经典算法动画图解
- 用图片签名时,如何解决签名的图片会盖住内容的问题
- 1419 最小公倍数挑战(素数性质之两两互质 与 取“3”个数的特殊性)
- 趣味计算:加油站加油
- 房地产投资占GDP比例畸高 中国房地产泡沫是一颗毒瘤
- 汉字编码(【Unicode】 【UTF-8】 【Unicode与UTF-8之间的转换】 【汉字 Unicode 编码范围】【中文标点Unicode码】【GBK编码】【批量获取汉字UNICODE码】)
- LLumar龙膜官宣品牌代言人——虚拟偶像「昤珑」
- Distinct语法的使用
- 微信如何解绑小程序_微信小程序解绑事件,微信小程序解除绑定
热门文章
- PS 图像尺寸|点阵格式图像|矢量格式图像|图像格式的选择
- [转载]全金属外壳——坦克遥控高射机枪
- Arduino可穿戴教程之第一个程序——连接硬件选择板子(二)
- Swift3.0语言教程字符串与URL的数据转换与自由转换
- 聚类时需要标准化吗_打球时意外受伤,同伴需要担责吗?
- java 反射 速度_Java反射获取实例的速度对比分析
- 每隔k次反转一次 链表_leetcode 25 K个一组翻转链表(c++)
- opencv python是什么_Python+OpenCV 十几行代码模仿世界名画
- axure中备注线_琉璃:璇玑小本子上,别人名字都有备注唯独司凤没有,意义很浪漫...
- python下载图片、已知url_python实现通过URL下载图片到本地服务器