QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#707674 | #6434. Paimon Sorting | sw7777# | WA | 0ms | 3612kb | C++20 | 862b | 2024-11-03 17:00:22 | 2024-11-03 17:00:22 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
const int N=1e6+10;
#define int long long
#define endl "\n"
int a[N];
signed main (){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int t;cin>>t;
while(t--){
int n;cin>>n;
for(int i=1;i<=n;i++){
cin>>a[i];
}
int de=0;
int ans=0;
for(int i=1;i<=n;i++){
if(i==1) cout<<ans<<" ";
else{
if(a[i]==a[i-1]){
ans+=de;
cout<<ans<<" ";
}else if(a[i]<a[i-1]){
de++;
ans+=de;
cout<<ans<<" ";
}else{
ans+=2;
cout<<ans<<" ";
}
}
}
cout<<endl;
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 3612kb
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 '