# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
971637 | vjudge1 | Star triangles (IZhO11_triangle) | C++98 | 1 ms | 344 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;
int ans=0;
pair<int,int> grid[n];
for (int i = 0; i < n; i++)
{
cin>>grid[i].first;
cin>>grid[i].second;
}
for (int i = 0; i < n; i++)
{
for (int j = i+1; j < n; j++)
{
if(grid[i].first==grid[j].first){
for (int d = 0; d < n; d++)
{
if(d!=i && d!= j && grid[i].first==grid[d].second){
ans++;
}
}
}
}
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |