Skip to content

Commit 2916e54

Browse files
committed
srm 561 div 1 250 sol
1 parent a736e2a commit 2916e54

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

ICPCBalloons.cpp

+2-12
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,9 @@ class ICPCBalloons {
4343
int total = accumulate(v.begin(), v.end(), 0), bal = accumulate(s.begin(), s.end(), 0), due = 0;
4444
if(bal < total) return inf;
4545
fi(min(m, n)){
46-
if(s[i] >= v[i]){
47-
bal -= v[i];
48-
}
49-
else {
50-
bal -= s[i];
51-
due += v[i] - s[i];
52-
}
53-
}
54-
if(n < m){
55-
ri(n, m) due += v[i];
46+
total -= min(v[i], s[i]);
5647
}
57-
if(bal < due) return inf;
58-
return due;
48+
return total;
5949
}
6050
int minRepaintings(vector <int> balloonCount, string balloonSize, vector <int> maxAccepted) {
6151
vi M, L;

0 commit comments

Comments
 (0)