Task: | Pakkaus |
Sender: | Senpai |
Submission time: | 2016-10-16 22:34:45 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
#2 | RUNTIME ERROR | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | RUNTIME ERROR | 0.42 s | 1 | details |
#2 | RUNTIME ERROR | 0.43 s | 1 | details |
#3 | RUNTIME ERROR | 1.33 s | 1 | details |
#4 | RUNTIME ERROR | 0.47 s | 1 | details |
#5 | RUNTIME ERROR | 0.47 s | 1 | details |
#6 | RUNTIME ERROR | 0.42 s | 2 | details |
#7 | RUNTIME ERROR | 0.43 s | 2 | details |
#8 | TIME LIMIT EXCEEDED | -- | 2 | details |
#9 | RUNTIME ERROR | 0.87 s | 2 | details |
#10 | RUNTIME ERROR | 1.33 s | 2 | details |
#11 | RUNTIME ERROR | 0.43 s | 3 | details |
#12 | RUNTIME ERROR | 0.43 s | 3 | details |
#13 | TIME LIMIT EXCEEDED | -- | 3 | details |
#14 | TIME LIMIT EXCEEDED | -- | 3 | details |
#15 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
#include <bits/stdc++.h> using namespace std; long long a,b,n,x,y; vector<long long>s; vector<long long> v; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> n; for(int i=0; i<n;i++){ cin>>b; v.push_back(b); } while(n!=0){ if(v[0]==1){ if(is_sorted(v.begin(),v.end())) break; } int k=0; if (v[0]==n){ for(int i=n-1; i>=0; i--){ x=i; if(abs(v[i]-v[i-1])!=1 && i!=0) { s.push_back(i); reverse(v.begin(),v.begin()+i); break; } else{ s.push_back(n); reverse(v.begin(),v.begin()+i); a++; break; } } if(a==1){ break; } } else if(v[1]==v[0]+1){ while(v[k+2]!=v[0]-1 && k!=n-1){k++;} s.push_back(k+2); reverse(v.begin(),v.begin()+(k+2)); } else if(v[1]!=v[0]+1){ while(v[k+1]!=v[0]+1 && k!=n-1){k++;} s.push_back(k+1); reverse(v.begin(),v.begin()+(k+1)); } else {a=a; } } y=s.size(); cout<<y<<"\n"; for(int i=0; i<y;i++){ cout<<s[i]<<" "; } }
Test details
Test 1
Group: 1
Verdict: RUNTIME ERROR
input |
---|
1AAAAAAAAAAAAAAAAAAAA |
correct output |
---|
AAAAAAAAAAAAAAAAAAAA |
user output |
---|
(empty) |
Test 2
Group: 1
Verdict: RUNTIME ERROR
input |
---|
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAA |
user output |
---|
(empty) |
Test 3
Group: 1
Verdict: RUNTIME ERROR
input |
---|
20A |
correct output |
---|
AAAAAAAAAAAAAAAAAAAA |
user output |
---|
(empty) |
Test 4
Group: 1
Verdict: RUNTIME ERROR
input |
---|
2N1J2F1XH2D2B2VT1N1ES |
correct output |
---|
NNJFFXHDDBBVTVTNES |
user output |
---|
(empty) |
Test 5
Group: 1
Verdict: RUNTIME ERROR
input |
---|
2Z1E1UN1P2A2A1D2F2EZ1FZ1J |
correct output |
---|
ZZEUNPAAAADFFEZEZFZJ |
user output |
---|
(empty) |
Test 6
Group: 2
Verdict: RUNTIME ERROR
input |
---|
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 7
Group: 2
Verdict: RUNTIME ERROR
input |
---|
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 8
Group: 2
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000A |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 9
Group: 2
Verdict: RUNTIME ERROR
input |
---|
11QOUDQFAFUPAYCPXZ15KANCLRGT9S... |
correct output |
---|
QOUDQFAFUPAYCPXZQOUDQFAFUPAYCP... |
user output |
---|
(empty) |
Test 10
Group: 2
Verdict: RUNTIME ERROR
input |
---|
20NFBIUXOSO10XRXZRMULZDUFK14BB... |
correct output |
---|
NFBIUXOSONFBIUXOSONFBIUXOSONFB... |
user output |
---|
(empty) |
Test 11
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1AAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: RUNTIME ERROR
input |
---|
1A1A1A1A1A1A1A1A1A1A1A1A1A1A1A... |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 13
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
1000000A |
correct output |
---|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA... |
user output |
---|
(empty) |
Test 14
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
87GEIGDBZCYGSFYYCGQUAWQJFUUAQG... |
correct output |
---|
GEIGDBZCYGSFYYCGQUAWQJFUUAQGDT... |
user output |
---|
(empty) |
Test 15
Group: 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
316XXYCLTBFQRAXHQPTLDB275NMQJD... |
correct output |
---|
XXYCLTBFQRAXHQPTLDBXXYCLTBFQRA... |
user output |
---|
(empty) |