https://i1.wp.com/eblogarithm.com/wp-content/uploads/2017/08/Codeforces-Round-426-Div-2-problem-A-The-Useless-Toy-Solution-In-CC1.png?fit=640%2C360

Codeforces Round #426 (Div. 2), problem: (A) The Useless Toy Solution In C/C++

#include<bits/stdc++.h>
using namespace std;
int t[1000];
int main(){
char a,b;
int n;
scanf(” %c %c”,&a,&b);
scanf(“%d”,&n);
n%=4;
t[‘^’]=0,t[‘>’]=1,t[‘v’]=2,t[‘<‘]=3;
int c=(t[a]-t[b]+4)%4;
if(n==0||n==2)puts(“undefined”);
else puts(n!=c?”cw”:”ccw”);
}

(Visited 50 times, 1 visits today)



There are no comments

Add yours

Leave a Reply

%d bloggers like this: