Submission #884789

# Submission time Handle Problem Language Result Execution time Memory
884789 2023-12-08T12:17:23 Z Isam Star triangles (IZhO11_triangle) C++17
100 / 100
238 ms 12260 KB
#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

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 time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 460 KB Output is correct
10 Correct 1 ms 348 KB Output is correct
11 Correct 1 ms 468 KB Output is correct
12 Correct 5 ms 1116 KB Output is correct
13 Correct 5 ms 1116 KB Output is correct
14 Correct 8 ms 1392 KB Output is correct
15 Correct 81 ms 6224 KB Output is correct
16 Correct 92 ms 6548 KB Output is correct
17 Correct 87 ms 6188 KB Output is correct
18 Correct 81 ms 6228 KB Output is correct
19 Correct 219 ms 11600 KB Output is correct
20 Correct 157 ms 9296 KB Output is correct
21 Correct 232 ms 12260 KB Output is correct
22 Correct 238 ms 12152 KB Output is correct