| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 134148 | huisung | Star triangles (IZhO11_triangle) | C++14 | 711 ms | 13320 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=int(a);i<=int(b);i++)
#define ROF(i,a,b) for(int i=int(b);i>=int(a);i--)
#define pb push_back
#define pq priority_queue
#define ps push
using namespace std;
struct point{int x,y;};
int n;
point in[300010];
long long anw;
map<int,long long> sero,garo;
int main(){
cin>>n;
FOR(i,1,n){
scanf("%d %d",&in[i].x,&in[i].y);
if(sero.find(in[i].y)==sero.end()) sero[in[i].y]=1;
else sero[in[i].y]++;
if(garo.find(in[i].x)==garo.end()) garo[in[i].x]=1;
else garo[in[i].x]++;
}
FOR(i,1,n) anw+=((garo[in[i].x]-1)*(sero[in[i].y]-1));
cout<<anw;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
