mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-08 13:38:48 +00:00
P2347 [NOIP1996 提高组] 砝码称重
R63050280
This commit is contained in:
parent
08e1ceaeb1
commit
9118c3f7c0
30
Luogu/P2347/P2347.cpp
Normal file
30
Luogu/P2347/P2347.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user