QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#128298 | #1171. Integer Array Shuffle | starrylasky | WA | 1ms | 3648kb | C++14 | 1.1kb | 2023-07-20 20:15:21 | 2023-07-20 20:15:23 |
Judging History
answer
///yl/hs/bx/yl
#include<bits/stdc++.h>
#define fep(i,l,r) for(int i=l;i<=r;++i)
#define feb(i,r,l) for(int i=r;i>=l;--i)
#define For(i,u) for(int i=head[u];i;i=e[i].nxt)
#define LL long long
// #define int long long
#define ld long double
#define pr pair<int,int>
#define mpr make_pair
using namespace std;
const int N = 1e6+5,mod = 1e9+7;
inline int read()
{
int s=0,w=1; char ch=getchar();
while(!(ch>='0'&&ch<='9')) {if(ch=='-') w=-1; ch=getchar();}
while( ch>='0'&&ch<='9') {s=(s<<1)+(s<<3)+ch-'0'; ch=getchar();}
return s*w;
}
inline int Mod(int x) {return x>=mod?x-mod:x;}
inline void addmod(int &x,int y) {x=Mod(x+y);}
namespace starrylasky
{
int n,a[N];
inline void Main()
{
n=read();
fep(i,1,n)
{
int x=read(); if(x==a[i-1]) --i,--n;
a[i]=x;
}
int cnt=0;
fep(i,1,n) if(a[i-1]<a[i]&&a[i]>a[i+1]) ++cnt;
// cerr<<cnt<<"\n";
printf("%d\n",cnt==0?0:((int)ceil(log2(cnt))+1));
}
}
signed main()
{
int _T=1;
while(_T--) starrylasky::Main();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3648kb
input:
3 2 2 5
output:
1
result:
wrong answer 1st numbers differ - expected: '0', found: '1'