| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1308535 | buinamkhanh | 별들과 삼각형 (IZhO11_triangle) | C++20 | 1 ms | 332 KiB |
#include <iostream>
#define int long long
using namespace std;
int n,x[300005],y[300005],a1,a2,ans=0;
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);cout.tie(0);
freopen("stdin","r",stdin);
freopen("stdout","w",stdout);
cin>>n;
for (int i=1; i<=n; i++)
cin>>x[i]>>y[i];
for (int i=1; i<=n; i++) {
a1=-1;a2=-1;
for (int j=1; j<=n; j++) {
if (x[j]==x[i]) a1++;
if (y[j]==y[i]) a2++;
}
ans+=a1*a2;
}
cout<<ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
