QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#625232#6439. Cloud Retainer's Gamewwww22#WA 0ms3592kbC++20691b2024-10-09 18:03:432024-10-09 18:03:44

Judging History

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

  • [2024-10-09 18:03:44]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3592kb
  • [2024-10-09 18:03:43]
  • 提交

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 
*/

詳細信息

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'