| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1219573 | lizi14 | Star triangles (IZhO11_triangle) | C++20 | 2095 ms | 1096 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin>>n;
vector<pair<int,int>>v(n);
for(int i=0; i<n; i++){
int j,k;
cin>>j>>k;
pair<int,int>p={j,k};
v[i]=p;
}
long long ans=0;
for(int i=0; i<v.size(); i++){
long long ans1=0,ans2=0;
for(int j=0; j<v.size(); j++){
if(v[j].first==v[i].first && j!=i)ans1++;
//else if(v[j].first>v[i].first)break;
if(v[j].second==v[i].second && i!=j)ans2++;
}
ans+=(ans2*ans1);
}
cout<<ans<<endl;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
