Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46526 | jiabokai | 填涂颜色 | C++ | Accepted | 0 MS | 268 KB | 354 | 2024-05-04 11:49:25 |
#include<bits/stdc++.h> using namespace std; int col[10005],row[10005]; 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; col[a]++; if(col[a]==1){ c++; } } for(int i=1,a;i<=y;i++){ cin>>a; row[a]++; if(row[a]==1){ r++; } } cout<<n*m-(c*m+r*n-c*r); return 0; }