QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#497736 | #6434. Paimon Sorting | buzhijingdi | WA | 0ms | 3792kb | C++14 | 1.3kb | 2024-07-29 16:41:11 | 2024-07-29 16:41:16 |
Judging History
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;
}
詳細信息
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 '