結果

問題 No.921 ずんだアロー
ユーザー mdstoymdstoy
提出日時 2019-11-08 22:42:43
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,095 bytes
コンパイル時間 1,821 ms
コンパイル使用メモリ 171,788 KB
実行使用メモリ 8,040 KB
最終ジャッジ日時 2023-10-13 04:20:58
合計ジャッジ時間 3,503 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 1 ms
4,352 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 WA -
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 39 ms
6,244 KB
testcase_11 WA -
testcase_12 AC 9 ms
4,352 KB
testcase_13 AC 29 ms
5,760 KB
testcase_14 AC 34 ms
5,880 KB
testcase_15 AC 20 ms
5,080 KB
testcase_16 AC 4 ms
4,348 KB
testcase_17 AC 35 ms
5,936 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 53 ms
8,040 KB
testcase_24 AC 10 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
#define sz(v) (int)v.size()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
const char EOL = '\n';

void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int n;
    cin >> n;
    map<int, int> z;
    int m;
    REP(i, n) {
        cin >> m;
        z[m]++;
    }
    int mx = 0;
    for (auto x : z) {
        chmax(mx, x.second);
    }
    cout << max((n + 1) / 2, mx) << EOL;
}
0