Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
56078 louhaoze 填涂颜色 C++ 通过 1 MS 324 KB 609 2024-11-09 10:01:58

Tests(1/1):


#include <iostream> using namespace std; int main() { int n, m, x, y; cin >> n >> m >> x >> y; int row[10001] = {0}; int col[10001] = {0}; for (int i = 0; i < x; i++) { int r; cin >> r; row[r] = 1; } for (int i = 0; i < y; i++) { int c; cin >> c; col[c] = 1; } int uncolored = 0; for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (!row[i] &&!col[j]) { uncolored++; } } } cout << uncolored << endl; return 0; }


测评信息: