Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
#define REP(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define REPR(i, n) for(ll (i) = (n); (i) >= 0; (i)--)
#define FOR(i, m, n) for(ll (i) = (m); (i) < (n); (i)++)
#define INF 1e9
#define ALL(v) v.begin(), v.end()
const double PI = 3.14159265358979323846;

using Graph = vector<vector<int>>;

template <uint MD> struct ModInt {
    using M = ModInt;
    const static M G;
    uint v;
    ModInt(ll _v = 0) { set_v(uint(_v % MD + MD)); }
    M& set_v(uint _v) {
        v = (_v < MD) ? _v : _v - MD;
        return *this;
    }
    explicit operator bool() const { return v != 0; }
    M operator-() const { return M() - *this; }
    M operator+(const M& r) const { return M().set_v(v + r.v); }
    M operator-(const M& r) const { return M().set_v(v + MD - r.v); }
    M operator*(const M& r) const { return M().set_v(uint(ull(v) * r.v % MD)); }
    M operator/(const M& r) const { return *this * r.inv(); }
    M& operator+=(const M& r) { return *this = *this + r; }
    M& operator-=(const M& r) { return *this = *this - r; }
    M& operator*=(const M& r) { return *this = *this * r; }
    M& operator/=(const M& r) { return *this = *this / r; }
    bool operator==(const M& r) const { return v == r.v; }
    M pow(ll n) const {
        M x = *this, r = 1;
        while (n) {
            if (n & 1) r *= x;
            x *= x;
            n >>= 1;
        }
        return r;
    }
    M inv() const { return pow(MD - 2); }
    friend ostream& operator<<(ostream& os, const M& r) { return os << r.v; }
};
using Mint = ModInt<1000000007>;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

using P = pair<ll, ll>;

int main()
{	
    ll n;
    cin >> n;
    ll zero;
    map<pair<ll, ll>, P> mp;
    REP(i, n){
        ll x, y;
        cin >> x >> y;
        if(x == 0 && y == 0){
            zero++;
            continue;
        }
        ll g = gcd(x, y);
        x /= g;
        y /= g;
        if(y < 0) x = -x, y = -y;           //180°回転させる
        if(y == 0 && x < 0) x = -x, y = -y; //180°回転させる
        bool rot90 = (x <= 0);
        if(rot90){                          //90°回転させる
            ll tmp = x;
            x = y; y = -tmp;
        }
        if(rot90) mp[{x.y}].first++;
        else mp[{x.y}].second++;

        Mint ans = 1;
        for(auto p : mp){
            ll s = p.second.first;
            ll t = p.second.second;
            Mint now = 1;
            now += Mint(2).pow(s) - 1;
            now += Mint(2).pow(t) - 1;
            ans *= now;
        }
        ans -= 1;
        ans += zero;
        cout << ans << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:82:25: error: request for member 'y' in 'x', which is of non-class type 'll' {aka 'long long int'}
   82 |         if(rot90) mp[{x.y}].first++;
      |                         ^
a.cc:82:21: error: no match for 'operator[]' (operand types are 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >' and '<brace-enclosed initializer list>')
   82 |         if(rot90) mp[{x.y}].first++;
      |                     ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&' {aka 'const std::pair<long long int, long long int>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&&' {aka 'std::pair<long long int, long long int>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:83:20: error: request for member 'y' in 'x', which is of non-class type 'll' {aka 'long long int'}
   83 |         else mp[{x.y}].second++;
      |                    ^
a.cc:83:16: error: no match for 'operator[]' (operand types are 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >' and '<brace-enclosed initializer list>')
   83 |         else mp[{x.y}].second++;
      |                ^
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&' {aka 'const std::pair<long long int, long long int>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<long long int, long long int>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::pair<long long int, long long int>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<long long int, long long int>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::map<std::pair<long long int, long long int>, std::pair<long long int, long long int> >::key_type&&' {aka 'std::pair<long long int, long long int>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~