QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#410785#6748. Spin the Wheelsheppard23WA 1ms3444kbC++14705b2024-05-14 14:52:012024-05-14 14:52:02

Judging History

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

  • [2024-05-14 14:52:02]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3444kb
  • [2024-05-14 14:52:01]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
const int N=1e7+10;
int a[N],p[N],ans[N];
int mod=998244353;
int qmid(int a,int b)
{
    int res=1;
    while(b)
    {
        if(b&1)
            res=res*a%mod;
        a=a*a%mod;
        b>>=1;
    }
    return res;
}
signed main()
{
    int n;
    cin>>n;
    int ans=0;
    map<int,int>mp;
    for(int i=1;i<=n;i++)
    {
        cin>>a[i];
        mp[a[i]]++;
        if(i>1)
        {
            if(a[i]>a[i-1])
                ans=a[i]-a[i-1];
        }
    }
    if(mp.size()!=n)
    {
        cout<<-1<<endl;
        return 0;
    }
    if(a[0]!=0)
        ans++;
    cout<<ans<<endl;
}

详细

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 3444kb

input:

5
1 3 0 2 4

output:

2

result:

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