ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1246. Tethered Dog

Why WA#10
Posted by Andy_spb 7 Nov 2010 16:51
// zadachki.cpp: определяет точку входа для консольного приложения.
//
#include <iostream>
#include "vector"
using namespace std;
int main()
{
   int n;
   double t;
   vector<double>x;
   vector<double>y;
   cin>>n;
   for(int i=0; i<n; i++)
   {
       cin>>t;
       x.push_back(t);
       cin>>t;
       y.push_back(t);
   }
   for(int i=0; i<n;i++)
   {
   double m=((x[(i+1)%n]-x[i])*(y[(i+2)%n]-y[(i+1)%n])-(x[(i+2)%n]-x[(i+1)%n])*(y[(i+1)%n]-y[i]));
   if (m>0) {cout<<"ccw"; return 0;}
   if (m<0) {cout<<"cw"; return 0;}
   }
   return 0;
}

WHY? Can anyone let me 7 test...
Re: Why WA#10
Posted by Andy_spb 7 Nov 2010 16:52
sorry... 10 test

Edited by author 07.11.2010 16:53