Codeforces Gym 100342C problem C. Painting Cottages conversion test Instructions

Source: Internet
Author: User

Problem C. Painting Cottages
Time Limit:2 Sec

Memory limit:256 MB

Topic Connection

Http://codeforces.com/gym/100342/attachments

Description

The new cottage settlement is organized near the capital of Flatland. The construction company, is building the settlement have decided to paint some cottages pink and others-light blue. However, they cannot decide which cottages must be painted which color. The director of the company claims the painting are nice if there are at least one pink cottage, at least one light blu E Cottage, and it is possible to draw a straight line in such a-line that pink cottages was at one side of the line, and Li Ght Blue Cottages is at the other side of the line (and no cottage was on the line itself). The main architect objects that there is several possible nice paintings.
Help them to find out how many different nice paintings is there

Input

The first line of the input file contains n-the number of the cottages (1≤n≤300). The following n lines contain the coordinates of the Cottages-each line contains the integer numbers xi and Yi (−104≤x I, yi≤104).

Output

Output One integer number-the number of different nice paintings of the cottages.

Sample Input

4
0 0
1 0
1 1
0 1

Sample Output

12

HINT

Test instructions

Give you n coordinates that point, find out how many methods of partitioning

The following:

Q God said test instructions transformation, is this n point, can connect how many different line segments,

For covered segments not included, ORZ Q God

Code:

1#include <cstdio>2#include <cmath>3#include <cstring>4#include <ctime>5#include <iostream>6#include <algorithm>7#include <Set>8#include <vector>9#include <queue>Ten#include <typeinfo> One#include <map> A#include <stack> - typedef __int64 LL; - #defineINF 1000000000000 the using namespacestd; - inline ll read () - { -ll x=0, f=1; +     CharCh=GetChar (); -      while(ch<'0'|| Ch>'9') +     { A         if(ch=='-') f=-1; atCh=GetChar (); -     } -      while(ch>='0'&&ch<='9') -     { -x=x*Ten+ch-'0'; -Ch=GetChar (); in     } -     returnx*F; to } +  - //************************************************************************************** the  *  $ structnodePanax Notoginseng { -     Doublex, y; the }; + intgcdintAintb) A { the     if(b==0)returnA; +     Else returnGCD (b,a%b); - } $map< pair<int,int>,int>H; $Node a[333]; - intMain () - { theFreopen ("cottages.in","R", stdin); -Freopen ("Cottages.out","W", stdout);Wuyi     intn=read (); the      for(intI=0; i<n;i++) -Cin>>a[i].x>>a[i].y; Wu     intans=0; -      for(intI=0; i<n;i++) About     { $ h.clear (); -          for(intj=i+1; j<n;j++) -         { -             intaa=a[i].x-a[j].x; A             intbb=a[i].y-a[j].y; +             intCc=gcd (AA,BB); the             if(H[make_pair (AA/CC,BB/CC)]==0) -             { $ans++; theH[make_pair (AA/CC,BB/CC)]=1; the             } the         } the     } -cout<<ans*2<<Endl; in}

Codeforces Gym 100342C problem C. Painting Cottages conversion test Instructions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.