Submission #887995

# Submission time Handle Problem Language Result Execution time Memory
887995 2023-12-15T17:38:42 Z Hovhannes1234 Star triangles (IZhO11_triangle) C++17
0 / 100
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	map <long long, long long> mp;
	for(int i=1; i<=n; i++){
		long long x,y;
		cin>>x>>y;
		mp[y]++;
	}
	long long ans=0;
	for(auto it : mp){
		if(it.second>1){
			ans+=(it.second*it.second-1)/2 * (n-it.second);
		}
	}
	cout<<ans<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 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 Incorrect 0 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -