|
|
|
|
讨论 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 |
|
|
|
|
|
|