답안 #481767

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
481767 2021-10-21T18:46:26 Z sicho_mohit Best Place (NOI17_bestplace) C++14
3 / 100
92 ms 2424 KB
#include<bits/stdc++.h>
using namespace std;
#define ff               first
#define ss              second
#define ll             long long
#define pb              push_back
#define pii             pair<int ,int>
#define pll      		pair<long ,long>
#define mii             map<int,int>
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define ull             unsigned long long
#define fastio          ios_base::sync_with_stdio();cin.tie(NULL)
const int mod = 1e9 + 7;
ll gcd(ll a, ll b) {if (b > a) {return gcd(b, a);} if (b == 0) {return a;} return gcd(b, a % b);}
ll binopow(ll b, ll pow) { if (pow == 0) return 1 ; ll ans; ans = binopow(b, pow / 2); ans = (ans * ans) % mod; if (pow % 2) ans = (ans * b) % mod; return ans; }
ll inv(ll a , ll mod) { return binopow(a, mod - 2); }
//------------------------------------------------------------------------------------------------------------------------------------------//
int main ()
{
	fastio;
	int n ;
	cin >> n;
	vector<pll>v;
	for (int i = 0; i < n; i++)
	{
		ll a, b ;
		cin >> a >> b;
		v.pb({a, b});
	}
	sort(v.begin(), v.end());
	if (n % 2 == 0)
	{
		cout << v[(n - 1) / 2].first << " " << v[(n - 1) / 2].second << "\n";
	}
	else
	{
		cout << (v[(n - 2) / 2].first + v[n - 1 / 2].first) / 2 << " " << 0 << "\n";
	}
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Incorrect 1 ms 204 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 2424 KB Output is correct
2 Correct 57 ms 2376 KB Output is correct
3 Incorrect 66 ms 2424 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 92 ms 2408 KB Output isn't correct
2 Halted 0 ms 0 KB -