제출 #730042

#제출 시각아이디문제언어결과실행 시간메모리
730042Akshat369Best Place (NOI17_bestplace)C++17
0 / 100
2 ms340 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define endl '\n' //#define size size() const int mod = 1000 * 1000 * 1000 + 7; const int N = 100005; signed main() { ios_base::sync_with_stdio(false); cin.tie(0); #ifndef ONLINE_JUDGE freopen("in.txt", "r", stdin); freopen("out.txt", "w", stdout); freopen("error.txt", "w", stderr); #endif int n; cin>>n; int a[n] , b[n]; for (int i = 0; i < n; ++i) { cin>>a[i]>>b[i]; } vector<pair<int, int > > v; for (int i = 0; i < n; ++i) { v.push_back({a[i],b[i]}); } sort(v.begin(), v.end()); cout<<v[n/2].first<<" "<<v[n/2].second<<endl; //cout<<v[n/2].second; }

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

bestplace.cpp: In function 'int main()':
bestplace.cpp:14:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     freopen("in.txt", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
bestplace.cpp:15:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |     freopen("out.txt", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
bestplace.cpp:16:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |     freopen("error.txt", "w", stderr);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
#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...