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 83 times, 1 visits today)

About the Author:

Leave A Comment