結果

問題 No.1390 Get together
ユーザー chacoder1
提出日時 2021-02-12 22:11:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 448 bytes
コンパイル時間 1,901 ms
コンパイル使用メモリ 196,216 KB
最終ジャッジ日時 2025-01-18 18:42:37
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
  int n,m;
  cin>>n>>m;
  vector<int>color[n];
  
  rep(i,n){
    int b,c;
    cin>>b>>c;
    b--;
    c--;
    color[c].push_back(b);
  }
  int ans=0;
  for(int i=0;i<n;i++){
    int cnt=0;
    for(auto j:color[i]){
      cnt++;
    }
    //cout<<i<<" "<<cnt<<endl;
    ans+=max(0,cnt-1);
  }
  cout<<ans<<endl;

  return 0;
}

0