TopCoder High School SRM 42 Level one - 250 pt - Fancy GUI editorial: http://community.topcoder.com/tc?module=Static&d1=hs&d2=match_editorials&d3=hs_srm42
TopCoder High School SRM 42 Level one - 250 pt - Fancy GUI solution:
#include <iostream> #include <vector> class FancyGUI{ public: int totalDarkArea(int n, std::vector <int> x1, std::vector <int> y1, std::vector <int> x2, std::vector <int> y2) { int cnt=0, a[105][105]={0}; for(int i=0; i<x1.size(); i++) for(int j=x1[i]; j<=x2[i]; j++) for(int k=y1[i]; k<=y2[i]; k++) a[j][k]++; for(int i=1; i<=100; i++) for(int j=1; j<=100; j++) if(a[i][j]<=n) cnt++; return 100*100-cnt; } };
No comments:
Post a Comment