# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
91839 | art85 | Star triangles (IZhO11_triangle) | C++14 | 2 ms | 376 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main(){
int n;
cin >> n;
double ans = 0;
int A[n][2];
for(int i = 0; i < n; i++){
for(int j = 0; j < 2; j++){
cin >> A[i][j];
}
}
for(int i = 0; i < n-1; i++){
for(int j = 0; j < n; j++){
if(A[i][0] == A[j][0] || A[i][1] == A[j][1]) ans += 0.5;
}
}
cout << int(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |