随笔分类 -  刷题笔记:挑战程序设计

摘要:Description People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there 阅读全文
posted @ 2020-08-12 20:24 RioTian 阅读(180) 评论(0) 推荐(0) 编辑
摘要:题目地址:http://poj.org/problem?id=1011 题目大意 给出n个小木棒,组合成若干长度最短棍子 解题思路 首先将木棒从大到小排序 dfs(k, l), k是还剩多少木棒没用,l是当前没组装成功的棍子还需多长木棒 剪枝(核心) 选取能被木棒总长度能整除的棍子长度 如果当前选取 阅读全文
posted @ 2020-08-10 15:57 RioTian 阅读(142) 评论(0) 推荐(0) 编辑
摘要:题目链接:https://ac.nowcoder.com/acm/contest/1014/B 题目描述 In the game of Sudoku, you are given a large 9 × 9 grid divided into smaller 3 × 3 subgrids. For 阅读全文
posted @ 2020-08-10 14:13 RioTian 阅读(247) 评论(3) 推荐(1) 编辑
摘要:一:部分和问题 给定整数a1、a2、.......an,判断是否可以从中选出若干数,使它们的和恰好为K。 输入: n=4 a={1,2,4,7} k=13 输出: Yes(13=2+4+7) 书中带来是DFS搜索,相对比较简单 代码: #include<bits/stdc++.h> using na 阅读全文
posted @ 2020-05-29 22:18 RioTian 阅读(697) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示