Advertisement
amine99

Untitled

Apr 14th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define _ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
  5. #define itloop(it,x) for(auto it=x.begin();it!=x.end();it++)
  6. #define reloop(i,e,b) for(auto i=e;i>=b;i--)
  7. #define loop(i,b,e) for(auto i=b;i<=e;i++)
  8. #define ALL(x) x.begin(),x.end()
  9. #define SZ(x) x.size()
  10. #define PB push_back
  11. #define MP make_pair
  12. #define F first
  13. #define S second
  14. typedef long long LL;
  15. typedef vector<int> VI;
  16.  
  17. typedef struct {
  18.    int x,y,z;
  19. }ship;
  20.  
  21. const int N=1e5+10;
  22. int n,x,y,z;
  23. char a,b,c,d;
  24. ship t[N];
  25. map<double,int> m;
  26.  
  27. int main() {_
  28.    cin >> n;
  29.    loop(i,1,n) {
  30.       cin >> a >> x >> b >> y >> c >> d >> z;
  31.       m[(double)(x+y)/(double)z]++;
  32.       t[i].x = x;
  33.       t[i].y = y;
  34.       t[i].z = z;
  35.    }
  36.    loop(i,1,n)
  37.       cout << m[(double)(t[i].x+t[i].y)/(double)t[i].z] << " ";
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement