General
 
 
# Author Problem Lang Verdict Time Memory Sent Judged  
9840737 Contestant:
maverick_xiii
514B - 32 GNU C++0x Accepted 31 ms 28 KB 2015-02-14 20:19:48 2015-02-14 21:53:03
 
 
→ Source
#include <iostream>
#include <vector>
#include <set>
#include <cmath>

using namespace std;

int gcd (int a, int b) {
	if (b == 0) {
		return a;
	}
	return gcd(b, a % b);
}

int main () {
	int N, x, y;
	cin >> N >> x >> y;
	set<pair<int, int> > slopes;
	for (;N--;) {
		int a, b;
		cin >> a >> b;		
		int  D = (a - x);
		int N = (b - y);
		int X = gcd(abs(N), abs(D));
		N /= X;
		D /= X;
		if (D < 0) {
			D *= -1;
			N *= -1;
		}
		if (D == 0) {
			N = -1;
		}
		slopes.insert({N,D});
	}
	cout << slopes.size() << "\n";
	return 0;
}
 
 
?
Time: ? ms, memory: ? KB
Verdict: ?
Input
?
Participant's output
?
Jury's answer
?
Checker comment
?
Diagnostics
?
Click to see test details