結果
問題 | No.275 中央値を求めよ |
ユーザー |
![]() |
提出日時 | 2020-11-06 15:34:09 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 529 bytes |
コンパイル時間 | 2,050 ms |
コンパイル使用メモリ | 196,240 KB |
最終ジャッジ日時 | 2025-01-15 20:03:38 |
ジャッジサーバーID (参考情報) |
judge3 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 28 WA * 10 |
ソースコード
#include <bits/stdc++.h> typedef long long ll; using namespace std; const int INF = 1e9; const int MOD = 1e9+7; const ll LINF = 1e18; using pii = pair<int,int>; #define FOR(i,a,b) for(int i=(a);i<(b);++i) #define REP(i,n) for(int i=0;i<(n);++i) #define COUT(x) cout<<(x)<<"\n" #define COUT15(x) cout << fixed << setprecision(15) << (x) << "\n"; int main(){ int n; cin >> n; vector<int> a(n); REP(i,n) cin >> a[i]; sort(a.begin(),a.end()); if(n%2!=0)COUT(a[n/2]); else COUT((a[n/2-1]+a[n/2])/2); }