HDU 6857 Clockwise or Counterclockwise

HDU 6857 Clockwise or Counterclockwise

思路:

简单计算一下行列式即可

x1  y1  1

x2  y2  1

x3  y3  1

结果如果

大于0,就是逆时针

小于0,就是顺时针

 

#include<bits/stdc++.h>
#define mem(a) memset(a,0,sizeof(a))
#define forn(i,n) for(int i=0;i<n;++i)
#define for1(i,n) for(int i=1;i<=n;++i)
#define IO std::ios::sync_with_stdio(false); std::cin.tie(0)
#define ll long long
#define inf 0x3f3f3f3f
using namespace std;
const int maxn=1e7+50;
const int mod=1e9+7;



int main()
{
    IO;
    int T;
    cin>>T;
    while(T--)
    {
        ll x1,x2,x3,y1,y2,y3;
        cin>>x1>>y1>>x2>>y2>>x3>>y3;
        ll ans=(x1-x3)*y2+(x3-x2)*y1+(x2-x1)*y3;
        if(ans>0)
            cout<<"Counterclockwise\n";
        else
            cout<<"Clockwise\n";
    }
    return 0;
}

 

posted @ 2020-08-16 11:22  小松QAQ  阅读(188)  评论(0编辑  收藏  举报