题解 | #邮票#

邮票

https://www.nowcoder.com/practice/b6735b1bd4ff488fb9a9032457410f66

#include <bits/stdc++.h>
using namespace std;

int main() {
    set<int>s;
    int total = 0;
    for (int i = 0; i <= 5; i++)
        for (int j = 0; j <= 4; j++)
            for (int k = 0; k <= 6; k++) {
                if (i + j + k >= 1) {
                    int money = i * 8 + j * 10 + k * 18;
                    if (s.find(money) == s.end()) {
                        s.insert(money);
                        total++;
                    }
                }
            }

    cout << total;

}
// 64 位输出请用 printf("%lld")

没必要dp

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务