点击这里更换您喜欢的皮肤wtboj 首页
请点击这里登入noios   首页 入门 c++讲义 入门教程视频 金牌教程 入门视频 站务 公告 | 题库 记录 竞测 测试 闯关 作业 排名 团队 讨论 | 换肤 | 登入 注册  
News >>   新增功能:各团队管理员可以发布本团队作业了 ()

From sina007
长方形
讨论 Discussion
 
我也是醉了
#include<bits/stdc++.h>
using namespace std;
long long  p,t,n,k,x=0 ;
int i,j;
int maxs=0;
bool f;
int a[100000][3]={0};
void zuida(int s){
if(s>maxs)maxs=s;
}
int main(){
freopen("p1583.in","r",stdin);
freopen("p1583.out","w",stdout);
scanf("%d",&n);
j =0;  maxs =0;
for (i=1;i<=n;i++){
scanf("%d",&k);
if(i==1){
x++;
a[x][1] =k;
a[x][2] =1;
zuida(a[x][1]*a[x][2]);
continue;
}
f=true;
t=1;
for(j=x;j>=1;j--)
if(a[j][1]<k){
a[j][2]=a[j][2]+1;
zuida(a[j][1]*a[j][2]);
}
else
{
p=j;if(a[j][2]+1>t)
t=a[j][2]+1;
f=false;
};
if(f){
x=x+1;
a[x][1]=k;
a[x][2]=1;
}
else
{
x=p;
a[x][1]=k;
a[x][2]=t;
}
zuida(k*t);
}
printf("%d",maxs);
fclose(stdin);
fclose(stdout);
return 0;
}//只能拿90分
( )

jjj
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m,num=0,u=0,w=0;
bool h=1;
cin>>n;
for(int i=1;i<=n;i++){
cin>>m;
u=m;
w=0;
while(m!=0){
w++;
m=m/10;
}
m=u;
num=0;
while(m!=0){
num+=pow(m%10,w);
m=m/10;

}
if(num==u){
cout<<"T\n";
}else{
cout<<"F\n";
}

}
// if(m>1){
// for(int i=n;i<=m;i++){
// h=1;
// for(int j=2;j<i;j++){
// if(i%j==0){
// h=0;
// break;
// }
// }
// if(h){
// num++;
// }
// }
// }
return 0;
}
( )
发布讨论主题 回复讨论主题
Flag
  
题号
  P1583
  其它
通过
  3人
提交
  100次
通过率
  3%
难度
  2
提交 讨论 题解
 Copyright wtboj © 2005-2006. www.wutuobang.date Powered by wtboj 关于 联系 帮助
 wtboj Information ---- Total Users : 1242 | Online Users / Processes : 0 / 54 | Processed Time : 128 ms | Server Time : 2025/4/27 3:13:25