Codeforces 834A
来源:互联网 发布:python sleep 毫秒 编辑:程序博客网 时间:2024/06/06 02:07
水题。无脑暴力,多种可能性穷举,每4次是一个循环,故对4取余,然后分顺逆时针可能性即可
#include<stdio.h>int main(void){ int c; char a, b; while (scanf("%c %c %d", &a, &b, &c) != EOF) { getchar(); if (c%4==0) { printf("undefined\n"); continue; } if (a == '^') { if (c%4==1) { printf("%s\n", b=='>'?"cw":"ccw"); } else if (c%4==2) { printf("undefined\n"); } else if (c%4==3) { printf("%s\n", b=='<'?"cw":"ccw"); } } if (a == '>') { if (c%4==1) { printf("%s\n", b=='v'?"cw":"ccw"); } else if (c%4==2) { printf("undefined\n"); } else if (c%4==3) { printf("%s\n", b=='^'?"cw":"ccw"); } } if (a == 'v') { if (c%4==1) { printf("%s\n", b=='<'?"cw":"ccw"); } else if (c%4==2) { printf("undefined\n"); } else if (c%4==3) { printf("%s\n", b=='>'?"cw":"ccw"); } } if (a == '<') { if (c%4==1) { printf("%s\n", b=='^'?"cw":"ccw"); } else if (c%4==2) { printf("undefined\n"); } else if (c%4==3) { printf("%s\n", b=='v'?"cw":"ccw"); } } } return 0;}
阅读全文
0 0
- Codeforces 834A
- CodeForces-a
- Codeforces 903A A
- Codeforces 834A-The Useless Toy
- Codeforces 834 A The Useless Toy
- CodeForces 834A The Useless Toy
- codeforces 834-A. The Useless Toy
- codeforces 834A The Useless Toy
- 【CodeForces】834A The Useless Toy 水
- CodeForces 18A A - Triangle
- CodeForces 133A A. HQ9+
- codeforces 651A A. Joysticks
- 【Codeforces 597A】A. Divisibility
- 【 Codeforces 615A】A. Bulbs
- A. Divisibility CodeForces 597A
- codeforces 417A A. Elimination
- CodeForces 534A A. Exam
- codeforces#98 a
- 初学Qt:QCheckBox
- Linux下使用unzip命令解压war包
- LeetCode 49 Group_Anagrams Java实现
- SSH与SSM学习之Spring20——Spring事务之Spring相关的基础
- CSS格式
- Codeforces 834A
- Error:Execution failed for task ':app:processDebugManifest'
- 美联航事件的系统思考
- Hadoop集群安装
- java作业
- 在c语言中宏和函数的区别
- 学习笔记TF054:TFLearn、Keras
- SpringMVC 接收时间类型
- SSH与SSM学习之Spring21——Spring事务之代码方式管理事务(基本不用)