답안 #730042

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
730042 2023-04-25T07:19:47 Z Akshat369 Best Place (NOI17_bestplace) C++17
0 / 100
2 ms 340 KB
#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;
    }

Compilation message

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);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 340 KB Unexpected end of file - int64 expected
2 Halted 0 ms 0 KB -