QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#625232 | #6439. Cloud Retainer's Game | wwww22# | WA | 0ms | 3592kb | C++20 | 691b | 2024-10-09 18:03:43 | 2024-10-09 18:03:44 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define fo(i,a,b) for(ll (i)=(a);(i)<=(b);(i)++)
#define fd(i,a,b) for(ll (i)=(a);(i)>=(b);(i)--)
using namespace std;
const int N=2e5+10;
int a[N],b[N];;
ll SORT(int n){
ll ans=0;
fo(i,1,n) b[i]=a[i];
fo(i,1,n)
{
fo(j,1,n)
if(b[i]<b[j])
swap(b[i],b[j]),ans++;
}
return ans;
}
int n;
void solve()
{
cin>>n;
fo(i,1,n) {
cin>>a[i];
cout<<SORT(i)<<" ";
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
int T=1;
cin>>T;
while(T--) solve();
return 0;
}
/*
2
13
1 5 9 8 45 6 8 7 2 2 1 1 35
9
1 5 9 8 45 6 8 7 2
*/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
2 4 3 1 1 2 2 6 2 4 3 1 3 3 5 1 7 3 3 1 4 2 3 1 1 6 2 9 1
output:
0 1 2 3 0 1
result:
wrong answer 1st numbers differ - expected: '3', found: '0'