# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
944473 | Zena_Hossam | Star triangles (IZhO11_triangle) | C++14 | 751 ms | 37492 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define fi ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll double
#define ll long long
//#define ll1 long long
#define F first
#define S second
#define sz size()
#define all(s) s.begin(),s.end()
#define all1(s) s.rbegin(),s.rend()
int main()
{
// freopen("measurement.in","r",stdin);freopen("measurement.out","w",stdout);
ll T=1;
//cin>>T;ll oo=0;
while(T--)
{
ll n;
cin>>n;
pair<ll,ll>a[n];map<ll,map<ll,ll>>m;
map<ll,ll>x,b;
for(ll i=0;i<n;i++){
cin>>a[i].first>>a[i].second;x[a[i].F]++;b[a[i].S]++;
m[a[i].first][a[i].second]++;
}ll c=0;
for(ll i=0;i<n;i++){ll g=a[i].first,h=a[i].second;
c+=(x[g]-1)*(b[h]-1)-(m[g][h]-1);
}cout<<c;
}
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |