Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
46705 sunhuifeng 填涂颜色 C++ 通过 1 MS 264 KB 342 2024-05-05 09:27:04

Tests(1/1):


#include<bits/stdc++.h> using namespace std; int co[10001],ro[10001]; int main(){ int n,m,x,y; cin>>n>>m>>x>>y; int c=0,r=0; for(int i=1,a;i<=x;i++){ cin>>a; co[a]++; if(co[a]==1){ c++; } }for(int i=1,a;i<=y;i++){ cin>>a; ro[a]++; if(ro[a]==1){ r++; } } cout<<n*m-(c*m+r*n-c*r); return 0; }


测评信息: