Submission #975093

# Submission time Handle Problem Language Result Execution time Memory
975093 2024-05-04T12:33:34 Z Amaarsaa Star triangles (IZhO11_triangle) C++14
100 / 100
247 ms 15028 KB
#include<bits/stdc++.h>

using namespace std;
using ll = long long ;
map < int,int > X, Y;
int main() {
//	freopen("moocast.in", "r", stdin);
//	freopen("moocast.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	ll t, n, m, ans, s, sum, r, p, i, j;

	cin >> n;
	
	
	ll x[n + 2], y[n + 2];
	for (i = 1; i <= n; i ++) {
		cin >> x[i] >> y[i];
		X[x[i]] ++;
		Y[y[i]] ++;
	}
	ans = 0;
	for (i = 1; i <= n; i ++) {
		s = (X[x[i]] - 1) * (Y[y[i]] - 1);
		ans += s;
	}
	cout << ans << endl;
	
}

Compilation message

triangle.cpp: In function 'int main()':
triangle.cpp:11:5: warning: unused variable 't' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |     ^
triangle.cpp:11:11: warning: unused variable 'm' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |           ^
triangle.cpp:11:22: warning: unused variable 'sum' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                      ^~~
triangle.cpp:11:27: warning: unused variable 'r' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                           ^
triangle.cpp:11:30: warning: unused variable 'p' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                              ^
triangle.cpp:11:36: warning: unused variable 'j' [-Wunused-variable]
   11 |  ll t, n, m, ans, s, sum, r, p, i, j;
      |                                    ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 456 KB Output is correct
8 Correct 0 ms 456 KB Output is correct
9 Correct 0 ms 344 KB Output is correct
10 Correct 1 ms 456 KB Output is correct
11 Correct 1 ms 348 KB Output is correct
12 Correct 5 ms 1116 KB Output is correct
13 Correct 5 ms 1288 KB Output is correct
14 Correct 7 ms 1628 KB Output is correct
15 Correct 87 ms 7204 KB Output is correct
16 Correct 87 ms 7256 KB Output is correct
17 Correct 82 ms 7068 KB Output is correct
18 Correct 83 ms 6992 KB Output is correct
19 Correct 226 ms 13828 KB Output is correct
20 Correct 161 ms 10796 KB Output is correct
21 Correct 244 ms 14644 KB Output is correct
22 Correct 247 ms 15028 KB Output is correct