QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#576757#9313. Make Maxeden369WA 0ms3648kbC++14505b2024-09-19 22:03:082024-09-19 22:03:08

Judging History

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

  • [2024-09-19 22:03:08]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3648kb
  • [2024-09-19 22:03:08]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

int n,m;
const int N=1e6+10;
int a[N];
int main(){
    int t;
    cin>>t;
    while(t--)
    {
        int ans=0;
        int n;
        cin>>n;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
        }
        sort(a+1,a+1+n);
        for(int i=1;i<=n;i++)
        {
            if(a[i]!=a[i-1]&&i!=1)
            {
                ans=ans+i;
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3648kb

input:

4
2
1 2
2
2 2
7
1 1 1 2 2 2 2
3
1 2 3

output:

2
0
4
5

result:

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