Pagini recente » Cod sursa (job #2670785) | Cod sursa (job #1613901) | Cod sursa (job #1076881) | Cod sursa (job #278603) | Cod sursa (job #1312551)
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define x first
#define y second
using namespace std;
int dx[] = {- 1 , 0 , 1 , 0};
int dy[] = {0 , 1 , 0 , -1};
vector<pii> x;
vector<double> rez;
double panta(pii a , pii b){
return ((b.y - a.y) / (b.x - a.x));
}
int main()
{
ifstream f("pachete.in");
ofstream g("pachete.out");
int n;
f>>n;
pii s;
f>>s.x;
f>>s.y;
for(int i = 1 ; i <= n ; ++i){
int a, b;
f>>a;
f>>b;
x.pb(mp(a,b));
}
for(int i = 0 ; i < x.size() ; ++i){
rez.pb(panta(x[i] , s));
}
sort(rez.begin() , rez.end());
int k = 0;
for(int i = 0 ; i < x.size() - 1 ; ++i){
if(x[i] != x[i + 1]){
++k;
}
}
g<<k;
return 0;
}