QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#55352 | #1171. Integer Array Shuffle | feecle6418 | WA | 2ms | 3632kb | C++20 | 423b | 2022-10-13 11:57:48 | 2022-10-13 11:57:49 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,cnt=0;
int main(){
cin>>n;
deque<int> a(n),b(n);
for(int i=0;i<n;i++)cin>>a[i];
while(!is_sorted(a.begin(),a.end())){
for(int i=0;i<n;i++){
if(a.front()<a.back()){
b.push_back(a.front());
a.pop_front();
}
else {
b.push_back(a.back());
a.pop_back();
}
}
swap(a,b);
cnt++;
}
cout<<cnt;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3488kb
input:
3 2 2 5
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
6 1 5 8 10 3 2
output:
1
result:
ok 1 number(s): "1"
Test #3:
score: 0
Accepted
time: 1ms
memory: 3600kb
input:
8 14253630 18210471 431833031 681754868 791250850 811241570 837112104 858531105
output:
0
result:
ok 1 number(s): "0"
Test #4:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
3 2 2 5
output:
0
result:
ok 1 number(s): "0"
Test #5:
score: -100
Wrong Answer
time: 2ms
memory: 3524kb
input:
7 4 2 4 2 5 3 4
output:
2
result:
wrong answer 1st numbers differ - expected: '3', found: '2'