Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <set>
- using namespace std;
- long double x, y;
- long long n, ans;
- set<pair<int, int>> s;
- ifstream fin("input.txt");
- ofstream fout("output.txt");
- int gcd (int a, int b) {
- return b ? gcd (b, a % b) : a;
- }
- int main()
- {
- ios::sync_with_stdio(0);
- fin >> n;
- for (int i = 0; i < n; i++)
- {
- fin >> x >> y;
- int g = gcd(x, y);
- s.insert(make_pair(x / g, y / g));
- }
- fout << s.size();
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement