Submission #884789

#TimeUsernameProblemLanguageResultExecution timeMemory
884789IsamStar triangles (IZhO11_triangle)C++17
100 / 100
238 ms12260 KiB
#include<bits/stdc++.h> #ifdef DEBUG #include "debug.h" #else #define debug(...) void(37) #endif using namespace std; signed main(){ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0); int N; cin >> N; map<int, int> X, Y; vector<pair<int, int>> A(N); for(register int i = 0; i < N; ++i){ cin >> A[i].first >> A[i].second; X[A[i].first]++, Y[A[i].second]++; } long long ans(0); for(register int i = 0; i < N; ++i){ ans += 1ll * (X[A[i].first] - 1) * (Y[A[i].second] - 1); } cout << ans << '\n'; return 0; }

Compilation message (stderr)

triangle.cpp: In function 'int main()':
triangle.cpp:17:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   17 |  for(register int i = 0; i < N; ++i){
      |                   ^
triangle.cpp:22:19: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   22 |  for(register int i = 0; i < N; ++i){
      |                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...