Submission #971637

#TimeUsernameProblemLanguageResultExecution timeMemory
971637vjudge1Star triangles (IZhO11_triangle)C++98
0 / 100
1 ms344 KiB
#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 timeMemoryGrader output
Fetching results...