| # | Time | Username | Problem | Language | Result | Execution time | Memory | 
|---|---|---|---|---|---|---|---|
| 1259863 | khaerulmamu | Star triangles (IZhO11_triangle) | C++20 | 1 ms | 328 KiB | 
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main (){
    int N;
    cin >> N;
    vector<pair<int,int>> t (N);
    for(int i=0; i<N; i++){
        cin >> t[i].first >> t[i].second;
    }
    ll ans=0;
    for(int i=0; i<N; i++){
        int x=0;
        int y=0;
        for(int j=0; j< N; j++){
            if(t[i].first==t[j].first && t[i].second == t[j].second)continue;
            if(t[i].first==t[j].first) y++;
            if(t[i].second==t[j].second) x++;
        }
        ans += min(x,y);
    }
    cout << ans <<endl;
    
}
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
