QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#73651#4423. AMPPZ in the times of diseasechenqingboruiWA 2ms3320kbC++14854b2023-01-27 13:35:282023-01-27 13:35:29

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-27 13:35:29]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3320kb
  • [2023-01-27 13:35:28]
  • 提交

answer

#include<bits/stdc++.h>
#define int long long
using namespace std;
int s[510],s1[510],a,n,f[510];
signed main()
{
    cin>>n>>a;
    for(int i=1;i<=n;i++)
        cin>>s[i];
    if(a==1)
    {
        for(int i=1;i<=n;i++)
            for(int j=1;j<=i;j++)
                if(s[i]>s[j])
                    s1[i]++;
        for(int i=1;i<=n;i++)
            cout<<s1[i]<<' ';
    }
    else
    {
        for(int i=n;i;i--)
        {
            int x=0;
            for(int j=0;j<n;j++)
            {
                if(s[i]==x&&!f[j])
                {
                    s1[i]=j;
                    f[j]=1;
                    break;
                }
                if(!f[j])
                    x++;
            }
        }
        for(int i=1;i<=n;i++)
            cout<<s1[i]<<' ';
    }
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 2ms
memory: 3320kb

input:

100
100000 20
270505 510725
245104 76414
131477 992924
781607 895592
562469 622976
564354 637966
980036 112090
522903 687218
113871 977855
6615 123673
13847 347618
657794 165707
420561 183995
11367 136391
507836 694877
985069 105115
774110 486921
14319 338715
774937 118145
981468 99089
803866 491315...

output:

20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

result:

wrong answer Integer 0 violates the range [1, 20] (test case 1)