fork download
  1. /*
  2.   Cred : SunnyYeahBoi
  3.   It's my last chance (⌐■_■)
  4.   Problem :
  5. */
  6.  
  7. #include<bits/stdc++.h>
  8.  
  9. using namespace std;
  10.  
  11. #define int long long
  12. #define double long double
  13. #define endl "\n"
  14. #define NAME "a"
  15.  
  16. const int MAXN = 1e6 + 5;
  17. const int inf = 1e18;
  18. const int MOD = 1e9 + 7;
  19.  
  20. void FileInput(){
  21. if(fopen(NAME".inp" , "r") == NULL)
  22. freopen(NAME".inp" , "w" , stdout);
  23. freopen(NAME".inp" , "r" , stdin);
  24. freopen(NAME".out" , "w" , stdout);
  25. }
  26.  
  27. int n;
  28. int a[MAXN];
  29. int cnt[200];
  30.  
  31. void solve(){
  32. cin >> n;
  33. for(int i = 1 ; i <= n ; i++)
  34. cin >> a[i];
  35.  
  36. int res = 0;
  37. for(int i = 1 ; i <= n ; i++){
  38. res += cnt[a[i] % 200];
  39. cnt[a[i] % 200] += 1;
  40. }
  41.  
  42. cout << res << endl;
  43. }
  44.  
  45. int32_t main(){
  46. FileInput();
  47. ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
  48. int t = 1;
  49. // cin >> t;
  50. while(t--)
  51. solve();
  52. return 0;
  53. }
  54.  
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty