题解 1197: 发工资咯

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

简单的贪心题

摘要:解题思路:     网站指定是贪心算法,那就是最简单的类似背包题目。先从最大面值的钱开始尝试注意事项:  参考代码:#include<bits/stdc++.h>using namespace std……

发工资咯(python)

摘要:解题思路:注意事项:参考代码:while True:    n, *salaries = list(map(int, input().split()))    if n == 0:        br……

6个if,暴力枚举法

摘要:解题思路:注意事项:参考代码:import java.util.Scanner; public class Main {     public static void main(String[……

小白随便写的,记录一下

```pythonrmb=[100,50,10,5,2,1]defchange_money(li):new_li=[0foriinrange(len(rmb))]#新列表存储每张人民币张数foriinli[1:]:#对列表里的每一个员工工资遍历index=0whilei!=0:#因为题目说工资均整数且

发工资咯(Java题解+递归+数组)

摘要:解题思路:注意事项:参考代码:import java.util.Scanner;public class Main {    // 定义人民币面额数组    static int[] denomina……

1197: 发工资咯

摘要:解题思路:注意事项:参考代码:def coin_change(n):     coins = [100, 50, 10, 5, 2, 1]     num = []     for coin i……

1197: 发工资咯(贪心算法)

摘要:核心:票票从大开始扣,数量是最少的代码:while True:     l = [int(x) for x in input().split()]     n = l[0]     if n =……

发工资咯 记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]

发工资咯,简单贪心

摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int main(){     // 定义变量n表示输入的整数个数,a数组……

发工资咯(贪心)

摘要:解题思路:贪心注意事项:参考代码:#include<iostream>#include<cmath>#include<cstring>using&nbs……