結果
| 問題 | No.3648 Overbooked Meeting Rooms |
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2026-08-29 14:49:24 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 446µs | |
| コード長 | 645 bytes |
| 記録 | |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 54,232 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-29 14:49:27 |
| 合計ジャッジ時間 | 1,868 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 30 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 3648.cc: No.3648 Overbooked Meeting Rooms - yukicoder
*/
#include<cstdio>
#include<algorithm>
using namespace std;
/* constant */
const int MAX_N = 500;
const int MAX_M = 500;
/* typedef */
/* global variables */
int as[MAX_N], bs[MAX_M], cs[MAX_M];
/* subroutines */
/* main */
int main() {
int n, m;
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++) scanf("%d", as + i), as[i]--;
for (int i = 0; i < m; i++) scanf("%d", bs + i);
for (int i = 0; i < n; i++) cs[as[i]]++;
int sum = 0;
for (int i = 0; i < m; i++) sum += max(0, cs[i] - bs[i]);
printf("%d\n", sum);
return 0;
}
tnakao0123