제출 #589884

#제출 시각아이디문제언어결과실행 시간메모리
589884f1nderBest Place (NOI17_bestplace)C++17
0 / 100
2 ms596 KiB
#include<bits/stdc++.h> using namespace std; void solve(); const int N=10005; int main() { ios_base::sync_with_stdio(false);cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("error.txt", "w", stderr); freopen("output.txt", "w", stdout); #endif int t=1; while(t--) { solve(); cout<<"\n"; } cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl; return 0; } void solve() { int n;cin>>n; std::vector<int> v,vi ; v.reserve(n);vi.reserve(n);int x,y; for (int i = 0; i < n; i++) { /* code */ cin>>x>>y; v.push_back(x); vi.push_back(y); } sort(v.begin(),v.end()); sort(vi.begin(),vi.end()); int a=v[(n/2)];int b=vi[(n/2)]; cout<<a<<" "<<b; }

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

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