0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-09-16 20:05:26 +00:00

P2347 [NOIP1996 提高组] 砝码称重

R63050280
This commit is contained in:
Baoshuo Ren 2021-11-19 20:26:16 +08:00 committed by Baoshuo Ren
parent 08e1ceaeb1
commit 9118c3f7c0
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

30
Luogu/P2347/P2347.cpp Normal file
View File

@ -0,0 +1,30 @@
#include <bits/stdc++.h>
using namespace std;
int w[10], ans;
bool cnt[1005];
int main() {
for (int i = 1; i <= 6; i++) {
cin >> w[i];
}
for (int a = 0; a <= w[1]; a++) {
for (int b = 0; b <= w[2]; b++) {
for (int c = 0; c <= w[3]; c++) {
for (int d = 0; d <= w[4]; d++) {
for (int e = 0; e <= w[5]; e++) {
for (int f = 0; f <= w[6]; f++) {
cnt[a + b * 2 + c * 3 + d * 5 + e * 10 + f * 20] = true;
}
}
}
}
}
}
for (int i = 1; i <= 1000; i++) {
ans += cnt[i];
}
cout << "Total=" << ans << endl;
return 0;
}