結果

問題 No.2563 色ごとのグループ
ユーザー DeltaStructDeltaStruct
提出日時 2023-10-27 10:49:53
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 389 bytes
コンパイル時間 2,472 ms
コンパイル使用メモリ 252,432 KB
実行使用メモリ 14,336 KB
最終ジャッジ日時 2023-12-02 14:00:47
合計ジャッジ時間 7,056 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,548 KB
testcase_01 AC 1 ms
6,548 KB
testcase_02 AC 1 ms
6,548 KB
testcase_03 AC 2 ms
6,548 KB
testcase_04 AC 1 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 1 ms
6,548 KB
testcase_07 AC 1 ms
6,548 KB
testcase_08 AC 2 ms
6,548 KB
testcase_09 AC 1 ms
6,548 KB
testcase_10 AC 1 ms
6,548 KB
testcase_11 AC 2 ms
6,548 KB
testcase_12 AC 1 ms
6,548 KB
testcase_13 AC 1 ms
6,548 KB
testcase_14 AC 3 ms
6,548 KB
testcase_15 AC 3 ms
6,548 KB
testcase_16 AC 2 ms
6,548 KB
testcase_17 AC 2 ms
6,548 KB
testcase_18 AC 2 ms
6,548 KB
testcase_19 AC 7 ms
6,548 KB
testcase_20 AC 13 ms
6,548 KB
testcase_21 AC 9 ms
6,548 KB
testcase_22 AC 8 ms
6,548 KB
testcase_23 AC 15 ms
6,548 KB
testcase_24 AC 180 ms
10,880 KB
testcase_25 AC 110 ms
8,832 KB
testcase_26 AC 170 ms
10,496 KB
testcase_27 AC 111 ms
7,552 KB
testcase_28 AC 219 ms
11,648 KB
testcase_29 AC 278 ms
14,336 KB
testcase_30 AC 247 ms
14,336 KB
testcase_31 AC 255 ms
14,336 KB
testcase_32 AC 247 ms
14,336 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main(){
  int n,m,a,b; cin >> n >> m;
  vector<int> C(n),CI(n); for (int& a:C) (cin >> a),++CI[a-1];
  set<pair<int,int>> P; int tm = m;
  while(m--){
    cin >> a >> b;
    if (C[a-1]==C[b-1]) --CI[C[a-1]-1];
    P.emplace(min(a,b),max(a,b));
  }
  assert(P.size()==tm);
  int r(0);
  for (int a:CI) if (a) r+=a-1;
  cout << r << endl;
}
0