QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#497736#6434. Paimon SortingbuzhijingdiWA 0ms3792kbC++141.3kb2024-07-29 16:41:112024-07-29 16:41:16

Judging History

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

  • [2024-07-29 16:41:16]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3792kb
  • [2024-07-29 16:41:11]
  • 提交

answer

#include <iostream>
#include <vector>

using namespace std;

int n;
vector<int>a(20050, 0);

int ppt(int nn)
{
        int num = 0;
        vector<int> tt(a.begin(), a.end());
        for (int i = 1; i <= nn; i++)
        {
                for (int j = 1; j <= nn; j++)
                        if (tt[i] < tt[j])
                        {
                                num++;
                                swap(tt[i], tt[j]);
                        }
        }
        return num;
}

int main(void)
{
        int nnt;
        cin >> nnt;
        while (nnt--)
        {
                int n;
                cin >> n;

                for (int i = 1; i <= n; i++)
                {
                        cin >> a[i];
                }

                for (int i = 1; i <= n; i++)
                {
                        cout << ppt(i) << " ";
                }
                cout << endl;
        }
/*
        for (int i = 1; i <= n; i++)
        {
                for (int j = 1; j <= n; j++)
                        if (a[i] < a[j])
                        {
                                cout << i << " " << j << endl;
                                swap(a[i], a[j]);
                        }
                cout << endl;
        }
*/
        return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3
5
2 3 2 1 5
3
1 2 3
1
1

output:

0 2 3 5 7 
0 2 4 
0 

result:

wrong answer 1st lines differ - expected: '0 2 3 5 7', found: '0 2 3 5 7 '