제출 #975878

#제출 시각아이디문제언어결과실행 시간메모리
975878vjudge1별들과 삼각형 (IZhO11_triangle)C++17
0 / 100
2 ms348 KiB
#include <bits/stdc++.h>
using namespace std;
#define futaba ios_base::sync_with_stdio(false); cin.tie(NULL);
#define rio return 0;
#define ll long long

// Fun things are fun. //

ll x[300005], y[300005];

int main() {
    freopen("generate.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    futaba
    int n;
    cin >> n;
    map<ll, ll> cntx, cnty;
    for(int i = 1; i <= n; i++) {
        cin >> x[i] >> y[i];
        cntx[x[i]]++;
        cnty[y[i]]++;
    }
    ll ans = 0;
    for(int i = 1; i <= n; i++) ans += ((cntx[x[i]] - 1) * (cnty[y[i]] - 1));
    cout << ans << '\n';
    rio
}

컴파일 시 표준 에러 (stderr) 메시지

triangle.cpp: In function 'int main()':
triangle.cpp:12:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |     freopen("generate.txt", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
triangle.cpp:13:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |     freopen("output.txt", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...