QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#128290#1171. Integer Array ShufflestarrylaskyWA 1ms3544kbC++141.1kb2023-07-20 20:10:572023-07-20 20:10:59

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-20 20:10:59]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3544kb
  • [2023-07-20 20:10:57]
  • 提交

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: 3544kb

input:

3
2 2 5

output:

1

result:

wrong answer 1st numbers differ - expected: '0', found: '1'