【Link】:http://codeforces.com/contest/834/problem/A

【Description】

【Solution】



开个大小为4的常量字符数组;

+n然后余4,-n然后余4;

相同位置就不行;

否则

判断是哪一种方式到最后一个字符

(没有非法的情况,所以不用考虑两种方式都不是,可以看题目描述有说)



【NumberOf WA】

【Reviw】

【Code】

#include <bits/stdc++.h>
using namespace std;
#define int long long const char temp[4] = {'v','<','^','>'}; char be[3],en[3];
int n; main(){
scanf("%s%s",be,en);
scanf("%lld",&n);
for (int i = 0;i <= 3;i++)
if (temp[i]==be[0]){
int cw = (i + n)%4;
int ccw = ((i-n)%4+4)%4;
if (cw==ccw){
return puts("undefined"),0;
}
if (temp[cw]==en[0]){
return puts("cw"),0;
}
if (temp[ccw]==en[0]){
return puts("ccw"),0;
}
puts("undefined");
break;
}
return 0;
}

【Codeforces Round #426 (Div. 2) A】The Useless Toy的更多相关文章

  1. 【Codeforces Round #426 (Div. 2) B】The Festive Evening

    [Link]:http://codeforces.com/contest/834/problem/B [Description] [Solution] 模拟水题; 注意一个字母单个出现的时候,结束和开 ...

  2. 【Codeforces Round #426 (Div. 2) C】The Meaningless Game

    [Link]:http://codeforces.com/contest/834/problem/C [Description] 有一个两人游戏游戏; 游戏包括多轮,每一轮都有一个数字k,赢的人把自己 ...

  3. 【Codeforces Round #432 (Div. 1) B】Arpa and a list of numbers

    [链接]h在这里写链接 [题意] 定义bad list是一个非空的.最大公约数为1的序列.给定一个序列,有两种操作:花费x将一个元素删除.花费y将一个元素加1,问你将这个序列变为good list所需 ...

  4. 【Codeforces Round #420 (Div. 2) C】Okabe and Boxes

    [题目链接]:http://codeforces.com/contest/821/problem/C [题意] 给你2*n个操作; 包括把1..n中的某一个数压入栈顶,以及把栈顶元素弹出; 保证压入和 ...

  5. 【Codeforces Round #420 (Div. 2) B】Okabe and Banana Trees

    [题目链接]:http://codeforces.com/contest/821/problem/B [题意] 当(x,y)这个坐标中,x和y都为整数的时候; 这个坐标上会有x+y根香蕉; 然后给你一 ...

  6. 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory

    [题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...

  7. 【Codeforces Round #423 (Div. 2) C】String Reconstruction

    [Link]:http://codeforces.com/contest/828/problem/C [Description] 让你猜一个字符串原来是什么; 你知道这个字符串的n个子串; 且知道第i ...

  8. 【Codeforces Round #423 (Div. 2) B】Black Square

    [Link]:http://codeforces.com/contest/828/problem/B [Description] 给你一个n*m的格子; 里面包含B和W两种颜色的格子; 让你在这个格子 ...

  9. 【Codeforces Round #423 (Div. 2) A】Restaurant Tables

    [Link]:http://codeforces.com/contest/828/problem/A [Description] 有n个组按照时间顺序来餐馆; 每个组由一个人或两个人组成; 每当有一个 ...

随机推荐

  1. JDBC连接ORACLE无法登陆java.sql.SQLException: ORA-01017: invalid username/password; logon denied

    当用jdbc连接Oracle数据库的时候 private Connection getConnection() throws SQLException { OracleDataSource ods = ...

  2. 【redis】redis命令集

    参考资料: http://www.cnblogs.com/woshimrf/p/5198361.html

  3. caioj 1069 动态规划入门(二维一边推2:顺序对齐)(最长公共子序列拓展总结)

    caioj 1068是最长公共子序列裸体,秒过, 就不写博客了 caioj 1069到1071 都是最长公共字序列的拓展,我总结出了一个模型,屡试不爽    (1) 字符串下标从1开始,因为0用来表示 ...

  4. 紫书 例题 10-18 UVa 11346(连续概率)

    就是面积计算,没什么好说的. #include<cstdio> #include<cmath> #define REP(i, a, b) for(int i = (a); i ...

  5. Unity Shader (四)顶点程序示例

    1.在顶点函数中实现凸起效果 Shader "Custom/Example" { properties { _R(,))= //圆的半径,也是凸起的范围 _OX(,))= //x轴 ...

  6. Testin实验室:陌陌APP通过率为94.92% 基本满足移动社交需求

    Testin实验室:陌陌APP通过率为94.92% 基本满足移动社交需求 2014/11/10 · Testin · 独家评測 11月8日,国内移动社交应用陌陌公开向美国证券交易委员会提交了IPO申请 ...

  7. Project Euler:Problem 58 Spiral primes

    Starting with 1 and spiralling anticlockwise in the following way, a square spiral with side length ...

  8. Windows 8 快捷键收集整理

    Windows键快捷方式列表 Windows键:打开開始屏幕 Windows键+空格键:切换输入语言和键盘布局 Windows键+O:禁用屏幕翻转 Windows键+,:暂时查看桌面 Windows键 ...

  9. Lesson 2 Building your first web page: Part 2

    Tag Diagram You may have noticed that HTML tags come in pairs; HTML has both an opening tag (<tag ...

  10. 对Jscript操作注册表接口的一点不解

    作者:朱金灿 来源:http://blog.csdn.net/clever101 要操作注册表需要通过ActiveX控件调用WScript.shell对象,通过该对象的一些方法来操作.Wshshell ...