首页
DreamJudge
院校信息
专业题库
模拟考试
机试真题
上岸课程
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
18919717626
2025年3月19日 23:47
邮票2 题解:
P1462
回复 0
|
赞 0
|
浏览 56
#include<iostream> #include<map> using namespace std; int main(){ map<int,int> m; map<int,int>:: iterator mit; int temp; for(int i=0;i<=5;i++){ for(...
930254841
2022年5月31日 09:34
回溯法
P1462
回复 0
|
赞 1
|
浏览 4.6k
思路:对于每张邮票,要么选,要么不选。如果选,需要判断数量是否>0。如果不选,直接跳过本层向下一层搜索。使用set去重。 #include <bits/stdc++.h> using namespace std; int nums[3] = {5, 4, 6}; int val[3] = {8, 10, 18}; unordered_set<int> st; int sum = 0; void dfs(int beginIndex) { if (beginIndex >= 3) ...
My_opt
2022年4月30日 16:24
c++
P1462
回复 0
|
赞 3
|
浏览 5.8k
#include <iostream> #include <unordered_map> using namespace std; unordered_map<int, bool> h; int main() { for (int i = 0; i <= 5; i ++ ) for (int j = 0; j <= 4; j ++ ) for (int k = 0; k <= 6; k ++ ) h[i * 8 + j * 10 + k * 18] = true; cout <...
liaow1
2022年4月5日 18:00
邮票2穷举法
P1462
回复 0
|
赞 3
|
浏览 4.0k
#include using namespace std; int main(){ int x=8,y=10,z=18; vector myvector; for(int a=0;a<=5;a++){//暴力穷举 for(int b=0;b<=4;b++){ ...
题目
邮票2
题解数量
4
发布题解
在线答疑
热门题解
1
c++
2
邮票2穷举法
3
回溯法
4
邮票2 题解: