Guest User

Untitled

a guest
May 1st, 2018
1,650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. const int MX = 2e5+5;
  3. using namespace std;
  4. typedef long long ll;
  5. int main() {
  6.   int n;cin>>n;ll a,b;cin>>a>>b;
  7.   map<ll,ll> vis;
  8.   map<pair<int,int>,int> sim;
  9.   ll ans = 0;
  10.   for(int i=1;i<=n;i++)
  11.   {
  12.         int x,vx,vy;
  13.        scanf("%d%d%d",&x,&vx,&vy);
  14.         ans += vis[a*vx-vy] - sim[{vx,vy}];
  15.         vis[a*vx-vy]++;
  16.         sim[{vx,vy}]++;
  17.   }
  18.   cout<<2*ans<<endl;
  19. }
Add Comment
Please, Sign In to add comment