Task: | Merkkijono |
Sender: | nokka7 |
Submission time: | 2018-01-18 14:17:48 +0200 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.04 s | details |
#2 | WRONG ANSWER | 0.04 s | details |
#3 | WRONG ANSWER | 0.05 s | details |
#4 | WRONG ANSWER | 0.04 s | details |
#5 | WRONG ANSWER | 0.05 s | details |
Code
#include <bits/stdc++.h> using namespace std; int t[101010]={0}; int c, e, f; string s; char a, b, d; int main() { c=0; cin >> s; while (true) { if (s[0]>s[1]) { if ((s[0]!='Z') &&(s[1]!='Z')) { t[c]=0; a=s[1]; b=s[0]; s[0]=a; s[1]=b; cout << s << "\n"; goto tassa; } } d=s[0]; s[0]=s[25]; t[c]=1; for (int i=1; i<25; i++) { f=s[i]; s[i]=d; d=f; } s[25]=d; cout << s << "\n"; e=0; for (int i=0; i<25; i++) { if (s[i]>s[i+1]) goto tassa; } break; tassa:; c++; } c+=1; cout << c << "\n"; if (c==0) {cout << "0";} else { for (int i=0; i<c; i++) { if (t[i]==1) { cout << "MOVE" << "\n"; continue;} cout << "SWAP" << "\n"; } } }
Test details
Test 1
Verdict: ACCEPTED
input |
---|
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
correct output |
---|
0 |
user output |
---|
ZABCDEFGHIJKLMNOPQRSTUVWXY YZABCDEFGHIJKLMNOPQRSTUVWX XYZABCDEFGHIJKLMNOPQRSTUVW WXYZABCDEFGHIJKLMNOPQRSTUV VWXYZABCDEFGHIJKLMNOPQRSTU ... |
Test 2
Verdict: WRONG ANSWER
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
AZYXWVUTSRQPONMLKJIHGFEDCB BAZYXWVUTSRQPONMLKJIHGFEDC ABZYXWVUTSRQPONMLKJIHGFEDC CABZYXWVUTSRQPONMLKJIHGFED ACBZYXWVUTSRQPONMLKJIHGFED ... |
Test 3
Verdict: WRONG ANSWER
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
PRJMFWBHYQOTXUAENLDGZISCVK KPRJMFWBHYQOTXUAENLDGZISCV VKPRJMFWBHYQOTXUAENLDGZISC KVPRJMFWBHYQOTXUAENLDGZISC CKVPRJMFWBHYQOTXUAENLDGZIS ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
TGWJSPBHANMXYFLKIDORVUCEZQ GTWJSPBHANMXYFLKIDORVUCEZQ QGTWJSPBHANMXYFLKIDORVUCEZ GQTWJSPBHANMXYFLKIDORVUCEZ ZGQTWJSPBHANMXYFLKIDORVUCE ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
VBJYNFLKEIUCZMQHRAXOGWPSDT BVJYNFLKEIUCZMQHRAXOGWPSDT TBVJYNFLKEIUCZMQHRAXOGWPSD BTVJYNFLKEIUCZMQHRAXOGWPSD DBTVJYNFLKEIUCZMQHRAXOGWPS ... |