結果

問題 No.3648 Overbooked Meeting Rooms
コンテスト
ユーザー pengin_2000
提出日時 2026-08-28 21:31:15
言語 C
(gcc 15.2.0)
コンパイル:
gcc-15 -O2 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 0 ms / 2,000 ms
+ 846µs
コード長 399 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 506 ms
コンパイル使用メモリ 38,912 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-28 21:31:37
合計ジャッジ時間 2,129 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<stdio.h>
int a[502], b[502], cnt[502];
int main()
{
	int n, m;
	scanf("%d %d", &n, &m);
	int i;
	for (i = 0; i < n; i++)
		scanf("%d", &a[i]);
	for (i = 0; i < m; i++)
		scanf("%d", &b[i]);
	for (i = 0; i < m; i++)
		cnt[i] = 0;
	for (i = 0; i < n; i++)
		cnt[--a[i]]++;
	int ans = 0;
	for (i = 0; i < m; i++)
		if (cnt[i] > b[i])
			ans += cnt[i] - b[i];
	printf("%d\n", ans);
	return 0;
}
0