A
#include//#include
using namespace std;
int main(){
int n,m;
cin>>n;// scanf("%d",&n);
int mx=0,mi=100009;
for(int j=0;jcin>>m; //scanf("%d",&m);
if(mxif(mi>m){
mi=m;
}
}
cout<" "<//printf("%d %d\n",mi,mx)
return 0;
}
B
#include
#include
using namespace std;
int main(){
int n,i,j;
cin>>n;
//两个判定条件 两个墙的判定 和空格的判定
//ofstream outfile("10.txt");
for(i=0;i//输出上面的倒三角 以及两边的墙 最后一行除一个*全都输出_
for(j=0;jif(j==0) cout<<"#";
else if(i==n-1)cout<<"_";
else cout<<" ";
}
for(j=1;j<=2*(n-i)-1;j++) cout<<"*";
for(j=0;jif(j==i-1) cout<<"#";
else if(i==n-1) cout<<"_";
else cout<<" ";
}
cout<for(i=1; i<=n;i++){//输出正三角 以及两边的墙
for(j=0;jif(j==0) cout<<"#";
else cout<<" ";
}
for(j=0;j<2*i-1;j++) cout<<"*";
for(j=0;jif(j==n-i-1) cout<<"#";
else cout<<" ";
}
cout<return 0;
C
#include
#include
using namespace std;
int main()
{
int n,sum;
while(scanf("%d",&n)==1)
{
sum=n;int j=0;
while(n>=3)
{
n/=3;
sum+=n;
j++;
if(j==3)
{
sum+=3;
n+=3;
}
}
printf("%d\n",sum);
}
}
D
#include
int main(){
int m,n,i,s1,s2;
scanf("%d",&m);
while(m--){
scanf("%d",&n);
for(i=3,s1=s2=1;i<=n;i++){
s1=s1+s2;s2=s1-s2;
}
printf("%d\n",s1);
}
}
E
#include
int main()
{
int a,b,n[10],m[10],t;
scanf("%d",&t);
for(int i=0; i"%d%d",&n[i],&m[i]);
for(int i=0; i4*n[i]-m[i])/2;
b = n[i] - a;
if ( m[i]%2 == 1 || a < 0 || b < 0)
printf("No answer\n");
else
printf("%d %d\n", a, b);
}
return 0;
}
F
#include
using namespace std;
int main(){
long long x,h,j,l=0,k;
cin>>x>>h;
l=1;//l记录总数
for(j=0;j//k 记录每一次传播的数量
l+=k;
}
cout<return 0;
}
G
#include
using namespace std;
long long a[1000001];
int main(){
int j,k,l=0,i;
while(cin>>k&&k){
a[l]=k;
l++;
}
for(j=l-1;j>=0;j--){
cout<" ";
}
return 0;
}
H
#include
using namespace std;
long long a[10000001]={0};
int main(){
int n,j,k=0,l=0,i=0;
cin>>n;
for(j=1;j<=n;j++){
cin>>a[j];
if(a[j]-a[j-1]==1){
k++;
if(k>l){
l=k;
//cout<
}
}
else k=1;
}
cout<return 0;
}
I
#include
int a[100001];
int main()
{
int n,k,x;
scanf("%d%d%d",&n,&k,&x);
for(int j=0;j"%d",&a[j]);
}
//sort(a,a+n);
int s=0;
for(int j=0;js+=a[j];
}
s+=k*x;
printf("%d\n",s);
return 0;
}