제출 #589853

#제출 시각아이디문제언어결과실행 시간메모리
589853f1nderBest Place (NOI17_bestplace)C++17
0 / 100
3 ms596 KiB
#include<bits/stdc++.h> using namespace std; void solve(); 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(n),vi(n) ; for (int i = 0; i < n; i++) { /* code */ cin>>v[i]>>vi[i]; } sort(v.begin(),v.end()); sort(vi.begin(),vi.end()); int mid=n/2; cout<<v[mid]<<" "<<vi[mid]; }

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

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