Submission #976472

# Submission time Handle Problem Language Result Execution time Memory
976472 2024-05-06T15:14:40 Z vjudge1 Star triangles (IZhO11_triangle) C++17
0 / 100
2000 ms 696 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main()
{
    int n;
    cin >> n;
    int x[n], y[n];
    
    
    for (int i=0;i<n;i++) {
    	cin >> x[i] >> y[i];
	}
    int ans = 0;
    for (int i=0;i<n;i++) {
    	for (int j=i+1;j<n;j++) {
    		for (int k=j+1;k<n;k++) {
    			
    			if (x[i] == x[j] || x[i] == x[k] || x[k] == x[j]) {
    				if (y[i] == y[j] || y[i] == y[k] || y[k] == y[j]) {
    					ans++;
					}
				}
    			
    			
			}
		}
	}
    
    cout << ans;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 344 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 696 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
7 Correct 0 ms 348 KB Output is correct
8 Correct 2 ms 348 KB Output is correct
9 Correct 32 ms 348 KB Output is correct
10 Correct 38 ms 348 KB Output is correct
11 Correct 116 ms 348 KB Output is correct
12 Execution timed out 2016 ms 604 KB Time limit exceeded
13 Halted 0 ms 0 KB -