| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 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;
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
