Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
47078 | ☩Deutschland☩ | 填涂颜色 | C++ | Accepted | 0 MS | 264 KB | 329 | 2024-05-12 11:33:39 |
#include<bits/stdc++.h> using namespace std; int col[10002],row[10002]; 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; }