結果

問題 No.1390 Get together
ユーザー kenken714kenken714
提出日時 2021-02-12 23:43:50
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 930 bytes
コンパイル時間 2,011 ms
コンパイル使用メモリ 185,136 KB
実行使用メモリ 26,216 KB
最終ジャッジ日時 2023-09-27 07:28:22
合計ジャッジ時間 6,554 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
9,612 KB
testcase_01 AC 4 ms
9,492 KB
testcase_02 AC 5 ms
9,484 KB
testcase_03 AC 6 ms
9,632 KB
testcase_04 AC 6 ms
9,732 KB
testcase_05 WA -
testcase_06 AC 6 ms
9,604 KB
testcase_07 WA -
testcase_08 AC 6 ms
9,664 KB
testcase_09 AC 7 ms
9,712 KB
testcase_10 AC 5 ms
9,480 KB
testcase_11 AC 4 ms
9,604 KB
testcase_12 AC 5 ms
9,592 KB
testcase_13 WA -
testcase_14 AC 5 ms
9,500 KB
testcase_15 AC 5 ms
9,476 KB
testcase_16 WA -
testcase_17 AC 141 ms
16,580 KB
testcase_18 AC 237 ms
26,216 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 142 ms
16,696 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 141 ms
16,628 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define FORR(i, m, n) for (ll i = m; i >= n; i--)
#define REPO(i, n) for (ll i = 1; i <= n; i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(), n.end()
#define MOD 1000000007
#define P pair<ll, ll>


ll n, m, ans;

ll cnt[210000], mx[210000];
vector<ll> s[210000];
int main(){
    cin >> n >> m;
	vector<ll> b(n), c(n);
	REP(i, n){
        cin >> b[i] >> c[i];
        s[c[i]].push_back(b[i]);
    }
	REP(i, 210000){
        map<ll, ll> mm;
        ll nm = 0;
        REP(j, s[i].size()){
            mm[s[i][j]]++;
            nm = max(nm, mm[s[i][j]]);
        }
        ans += s[i].size() - nm;
    }
    cout << ans << endl;
}
0