結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 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 2 ms
6,548 KB
testcase_05 AC 2 ms
6,548 KB
testcase_06 AC 2 ms
6,548 KB
testcase_07 AC 1 ms
6,548 KB
testcase_08 AC 2 ms
6,548 KB
testcase_09 AC 2 ms
6,548 KB
testcase_10 AC 1 ms
6,548 KB
testcase_11 AC 1 ms
6,548 KB
testcase_12 AC 2 ms
6,548 KB
testcase_13 AC 1 ms
6,548 KB
testcase_14 AC 2 ms
6,548 KB
testcase_15 AC 4 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 5 ms
6,548 KB
testcase_20 AC 11 ms
6,548 KB
testcase_21 AC 7 ms
6,548 KB
testcase_22 AC 6 ms
6,548 KB
testcase_23 AC 10 ms
6,548 KB
testcase_24 AC 92 ms
6,548 KB
testcase_25 AC 78 ms
6,548 KB
testcase_26 AC 105 ms
6,548 KB
testcase_27 AC 88 ms
6,548 KB
testcase_28 AC 119 ms
6,548 KB
testcase_29 AC 164 ms
6,548 KB
testcase_30 AC 171 ms
6,548 KB
testcase_31 AC 163 ms
6,548 KB
testcase_32 AC 164 ms
6,548 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];
  while(m--){
    cin >> a >> b;
    if (C[a-1]==C[b-1]) --CI[C[a-1]-1];
  }
  int r(0);
  for (int a:CI) if (a>0) r+=a-1;
  cout << r << endl;
}
0