제출 #1306995

#제출 시각아이디문제언어결과실행 시간메모리
1306995abyfu별들과 삼각형 (IZhO11_triangle)C++20
100 / 100
250 ms7036 KiB
//OwO //#pragma GCC optimize("O3", "unroll-loops") #include <bits/stdc++.h> #define ll long long #define ld long double #define namein "input.txt" #define nameout "output.txt" #define pque priority_queue #define all(x) x.begin(),x.end() #define fi first #define se second #define pb push_back #define m_pi acos(-1) using namespace std; const ll inf = 4e18; const int linf = 1.5e9; void file(){ if (fopen(namein, "r")){ freopen(namein, "r", stdin); freopen(nameout, "w", stdout); } } const ll mod = 1e9 + 7; const int N = 3e5 + 5, M = 5e1 + 5; map<ll, ll> x, y; int a[N], b[N]; void run(){ int n; cin >> n; for (int i = 1; i <= n; i++){ cin >> a[i] >> b[i]; x[a[i]]++; y[b[i]]++; } ll as = 0; for (int i = 1; i <= n; i++){ as += (x[a[i]] - 1)*(y[b[i]] - 1); //cout << (x[a[i]] - 1)*(y[b[i]] - 1) << " " << a[i] << " " << b[i] << "\n"; } cout << as; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); file(); run(); }

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

triangle.cpp: In function 'void file()':
triangle.cpp:20:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   20 |         freopen(namein, "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~
triangle.cpp:21:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   21 |         freopen(nameout, "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...