简单的贪心题 摘要:解题思路: 网站指定是贪心算法,那就是最简单的类似背包题目。先从最大面值的钱开始尝试注意事项: 参考代码:#include<bits/stdc++.h>using namespace std…… 题解列表 2024年02月08日 0 点赞 0 评论 505 浏览 评分:0.0
发工资咯(python) 摘要:解题思路:注意事项:参考代码:while True: n, *salaries = list(map(int, input().split())) if n == 0: br…… 题解列表 2024年03月10日 0 点赞 0 评论 540 浏览 评分:0.0
6个if,暴力枚举法 摘要:解题思路:注意事项:参考代码:import java.util.Scanner; public class Main { public static void main(String[…… 题解列表 2024年03月24日 0 点赞 0 评论 502 浏览 评分:0.0
小白随便写的,记录一下 ```pythonrmb=[100,50,10,5,2,1]defchange_money(li):new_li=[0foriinrange(len(rmb))]#新列表存储每张人民币张数foriinli[1:]:#对列表里的每一个员工工资遍历index=0whilei!=0:#因为题目说工资均整数且 题解列表 2024年03月26日 0 点赞 0 评论 601 浏览 评分:0.0
发工资咯(Java题解+递归+数组) 摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main { // 定义人民币面额数组 static int[] denomina…… 题解列表 2024年03月30日 0 点赞 0 评论 603 浏览 评分:6.0
1197: 发工资咯 摘要:解题思路:注意事项:参考代码:def coin_change(n): coins = [100, 50, 10, 5, 2, 1] num = [] for coin i…… 题解列表 2024年04月09日 0 点赞 0 评论 700 浏览 评分:0.0
1197: 发工资咯(贪心算法) 摘要:核心:票票从大开始扣,数量是最少的代码:while True: l = [int(x) for x in input().split()] n = l[0] if n =…… 题解列表 2024年08月30日 0 点赞 0 评论 562 浏览 评分:0.0
发工资咯 记way #includeusingnamespacestd;intdir[]={100,50,10,5,2,1};intmain(){intn,m,ans;while(cin>>n&&n){ans=0;while(n--){cin>>m;for(inti=0;i<6&&m;++i){ans+=m/dir[i] 题解列表 2024年11月14日 0 点赞 0 评论 611 浏览 评分:0.0
发工资咯,简单贪心 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){ // 定义变量n表示输入的整数个数,a数组…… 题解列表 2024年11月16日 0 点赞 0 评论 628 浏览 评分:0.0
发工资咯(贪心) 摘要:解题思路:贪心注意事项:参考代码:#include<iostream>#include<cmath>#include<cstring>using&nbs…… 题解列表 2025年02月02日 2 点赞 0 评论 678 浏览 评分:10.0