제출 #494310

#제출 시각아이디문제언어결과실행 시간메모리
494310BeanZBest Place (NOI17_bestplace)C++14
100 / 100
37 ms2480 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' const int N = 3e5 + 5; long long mod = 1e9 + 7; const int lim = 4e5 + 5; const int lg = 21; const int base = 37; const long double eps = 1e-6; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); if (fopen("tests.inp", "r")){ freopen("tests.inp", "r", stdin); freopen("tests.out", "w", stdout); } ll n; cin >> n; vector<ll> vx, vy; for (int i = 1; i <= n; i++){ ll x, y; cin >> x >> y; vx.push_back(x); vy.push_back(y); } sort(vx.begin(), vx.end()); sort(vy.begin(), vy.end()); cout << vx[vx.size() / 2] << " " << vy[vy.size() / 2]; } /* Ans: Out: */

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

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