杭電2021發工資題
本菜雞聽dalao說這是簡單的貪心算法;加油吧菜雞
#include<iostream>
using namespace std;
int main()
{
int n, m, ans;
while (cin >> n&&n)
{
ans = 0;
for (int i = 0; i < n; i++)
{
cin >> m;
ans += (m / 100 + m % 100 / 50 + m % 100 % 50 / 10 + m % 100 % 50 % 10 / 5 + m % 100 % 50 % 10 % 5 / 2 + m % 100 % 50 % 10 % 5 % 2 / 1);
}
cout << ans << endl;
}
return 0;
}
杭電2021發工資題
相關推薦
杭電2021發工資題
bsp dal 心算 name end return main spa 貪心算法 本菜雞聽dalao說這是簡單的貪心算法;加油吧菜雞 #include<iostream>using namespace std;int main(){ int n, m, an
杭電ACM2022--發工資咯:)
發工資咯:) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 86355
hdu 2021 發工資咯:)(c語言)
hdu 2021 發工資咯:) 點選做題網站連結 題目描述 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description 作為杭電的
杭電ACM第1002題(A + B Problem II)答案 java版
方法一: package hduacm; import java.util.Scanner; public class Main{ public static void main(String[] args) throws Exception{
老孃的Java入門啦之——幾道杭電上的入門題 1091
1091 A+B for Input-Output Practice (III) Time Limit: 2000/1000 MS (Java/Others) Memo
杭電ACM第1008題——Elevator
#include <stdio.h> #include <stdlib.h> int main() { int n,i,flag; while(scanf("%d",&n)&&n) { int *a=(int *)m
老孃的Java入門啦之——幾道杭電上的入門題 1092
1092 A+B for Input-Output Practice (IV) Time Limit: 2000/1000 MS (Java/Others) Memory
杭電ACM第1005題——Number Sequence
#include <stdio.h> #include <stdlib.h> int main(){ int a,b,n,i; while(scanf("%d %d %d",&a,&b,&n)&&(a
杭電acm第1003題Max Sum ( 動態規劃)
Max Sum Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 169492 Accepted Submi
Number Sequence 【杭電-1005】 附題+詳解
/*Number Sequence Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others
杭電1004(簡單題)
Problem Description Contest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges’ f
杭電ACM第1003題——Max Sum
#include <stdio.h> #include <stdlib.h> int main() { int T,sum,start,end,i,j,k,r,num,s; scanf("%d",&T); for(r=1;r<
杭電ACM第1007題——Quoit Design
#include <iostream> #include <algorithm> #include <cmath> using namespace std; const int SIZE = 100005; typedef struct { double x; dou
Tri Tiling HDU 杭電1143 【規律題】
Problem Description In how many ways can you tile a 3xn rectangle with 2x1 dominoes? Here is a sample tiling of a 3x12 rectangle. Inp
【杭電oj2021】發工資咯:)
發工資咯:) Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 51230 Accepted Submis
HDU 4920(杭電多校訓練#5 1010 題) Matrix multiplication(不知道該掛個什麽帽子。。。)
預處理 ica ref 循環 ring sca esp 題解 code 題目地址:HDU 4920 對這個題簡直無語到極點。。。竟然O(n^3)的復雜度能過。。。。方法有三。。 1:進行輸入優化和輸出優化。。(前提是你的輸入優化不能太搓。。。) 2:利用緩存優化。。詳情
HDU 4968(杭電多校#9 1009題)Improving the GPA (瞎搞)
popu 推斷 imp 暴力枚舉 pop ++ pos nan sin 題目地址:HDU 4968 這題的做法是全部學科的學分情況枚舉,然後推斷在這樣的情況下是否會符合平均分。直接暴力枚舉就可以。 代碼例如以下: #include <cstring> #i
杭電(hdu)2053 Switch Game 水題
center ++ class chang names top weight ext == Switch Game Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (J
hdu 2018(母牛問題)2019(數列有序!)2020(絕對值排序 )2021(發工資)2022(海選女主角)
amp pre == 數組 sca int 如果 fab main 要發現它的規律,題n年牛的總數等於n-1年的母牛數加上第n年新增的母牛數,第n年只有n-3年的那些母牛才能產母牛,所以第n年的母牛數等於第n-1和n-3年的母牛數的和,即sum(n)=sum(n-1)+su
杭電多校第一場補題-1002 Balanced Sequence
names tar clas n) 遇見 include per 不為 return 1002: Balanced Sequence 題意:給定n個字符串,n的大小在1e5左右,字符串的長度也是1e5,字符串僅由‘(’或‘)’組成,合法串可以不是連續的,將這n個串按照一定的