Editorial for Cho điểm
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Với bài toán này ta tính tổng ~S~ với ~S = \sum^{i = 6}_{i = 1}{max(0, P_i - (S_i - 1) \times (P_i \div 10))}~.
Accepted Code
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int ans = 0;
for (int i = 1; i <= 6; ++i) {
int p, s;
cin >> p >> s;
ans += max(0, p - (s - 1) * (p / 10));
}
cout << ans << '\n';
}
Comments