結果

問題 No.3648 Overbooked Meeting Rooms
コンテスト
ユーザー UT0911
提出日時 2026-07-19 20:01:55
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 523µs
コード長 312 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 542 ms
コンパイル使用メモリ 88,448 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-28 20:51:00
合計ジャッジ時間 2,097 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<iostream>
#include<vector>

using namespace std;

int main(){
	int N,M;
	cin >> N >> M;
	vector<int> count(M+1,0);
	int ans=0;
	for(int i=0;i<N;i++){
		int A;
		cin >> A;
		count[A]++;
	}
	
	for(int i=1;i<=M;i++){
		int B;
		cin >> B;
		if(B<count[i]){
			ans+=count[i]-B;
		}
	}
	cout << ans << "\n";
}
0