日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

2017光棍节新生训练赛

發(fā)布時(shí)間:2025/7/25 编程问答 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 2017光棍节新生训练赛 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Description

There are some students in a class, Can you help teacher find the highest student .

Input

There are some cases. The first line contains an integer t, indicate the cases; Each case have an integer n ( 1 ≤ n ≤ 100 ) , followed n students’ height.

Output

For each case output the highest height, the height to two decimal plases;

Sample Input

2 3 170.00 165.00 180.00 4 165.00 182.00 172.00 160.00

Sample Output

180.00 182.00 //水題
#include<stdio.h> int main() { int a,c,k,i; double b; double MAX=0.0; scanf("%d",&c); for(k=1;k<=c;k++){ double max=0.0; scanf("%d",&a); for(i=1;i<=a;i++) { scanf("%lf",&b); if(max<b) max=b; MAX=max; }printf("%.2lf\n",MAX); } return 0; }

?

HDU 2567

?

#include<stdio.h> #include<string.h> int main() {int i,x,y,c,d,z;char a[50],b[50];scanf("%d",&x);for(i=1;i<=x;i++){scanf("%s",a);scanf("%s",b);c=strlen(a);d=strlen(b);for(z=1,y=1;y<=(c/2);y++){a[c+d-z]=a[c-z];z++;}for(y=1;y<=d;y++)a[c/2+y-1]=b[y-1];a[c+d]='\0';printf("%s\n",a);} }

HDU 2568

?

?

#include<stdio.h> int main() { int a,n; int A,B;scanf("%d",&a);for(int i=1;i<=a;i++) { A=0;B=0; scanf("%d",&n); while(n!=0) {if(n%2==0) //oushu{A++;n=n/2; }else {B++;n=n-1;}} printf("%d\n",B); }return 0;}

Description

假設(shè)一堆由1分、2分、5分組成的n個(gè)硬幣總面值為m分,求一共有多少種可能的組合方式(某種面值的硬幣可以數(shù)量可以為0)。

Input

輸入數(shù)據(jù)第一行有一個(gè)正整數(shù)T,表示有T組測(cè)試數(shù)據(jù);?
接下來的T行,每行有兩個(gè)數(shù)n,m,n和m的含義同上。?

Output

對(duì)于每組測(cè)試數(shù)據(jù),請(qǐng)輸出可能的組合方式數(shù);?
每組輸出占一行。?

Sample Input

2 3 5 4 8

Sample Output

1 2 #include <stdio.h>int main() {int n, m, x, y, cnt, t, tmp, i;scanf("%d", &t);while(t--){scanf("%d%d", &n, &m);tmp = 5 * n - m;for(i = cnt = 0; i <= n; ++i)for(int j = 0; j <= n; ++j)if(4*i+3*j==tmp && i+j<=n)++cnt;printf("%d\n", cnt);}return 0; }

HDU 5538

?

?

#include<cstdio> #include<algorithm> #include<string.h> #include<stdlib.h> #include<math.h> #define FIN freopen("in.txt","r",stdin) #define eps 1e-9 using namespace std; int mp[55][55],cnt,n,m; int to[][2]={0,1,0,-1,1,0,-1,0}; int main(){ int T; // FIN; scanf("%d",&T); while(T--){ scanf("%d%d",&n,&m); int top=0; cnt=0; for(int i=0;i<n;i++) for(int j=0;j<m;j++){ scanf("%d",&mp[i][j]); top=max(top,mp[i][j]); if(mp[i][j]) cnt++; cnt+=mp[i][j]*4; } for(int x=0;x<n;x++){ for(int y=0;y<m;y++){ for(int i=0;i<4;i++){ int xx=x+to[i][0],yy=y+to[i][1]; if(xx<0||yy<0||xx>=n||yy>=m) continue; cnt-=min(mp[x][y],mp[xx][yy]); } } } printf("%d\n",cnt); } return 0; }

?

?

轉(zhuǎn)載于:https://www.cnblogs.com/wuruofeng/p/7820232.html

總結(jié)

以上是生活随笔為你收集整理的2017光棍节新生训练赛的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。