CSES - Datatähti 2018 loppu - Results
Submission details
Task:Merkkijono
Sender:nokka7
Submission time:2018-01-18 13:38:43 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#20.05 sdetails
#30.05 sdetails
#40.05 sdetails
#50.05 sdetails

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";
	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:

input
ZYXWVUTSRQPONMLKJIHGFEDCBA

correct output
923
MOVE
MOVE
SWAP
MOVE
...

user output
AZYXWVUTSRQPONMLKJIHGFEDCB
BAZYXWVUTSRQPONMLKJIHGFEDC
ABZYXWVUTSRQPONMLKJIHGFEDC
CABZYXWVUTSRQPONMLKJIHGFED
ACBZYXWVUTSRQPONMLKJIHGFED
...

Test 3

Verdict:

input
RPJMFWBHYQOTXUAENLDGZISCVK

correct output
611
SWAP
MOVE
MOVE
SWAP
...

user output
PRJMFWBHYQOTXUAENLDGZISCVK
KPRJMFWBHYQOTXUAENLDGZISCV
VKPRJMFWBHYQOTXUAENLDGZISC
KVPRJMFWBHYQOTXUAENLDGZISC
CKVPRJMFWBHYQOTXUAENLDGZIS
...

Test 4

Verdict:

input
GWJSPBHANMXYFLKIDORVUCEZQT

correct output
659
MOVE
SWAP
MOVE
SWAP
...

user output
TGWJSPBHANMXYFLKIDORVUCEZQ
GTWJSPBHANMXYFLKIDORVUCEZQ
QGTWJSPBHANMXYFLKIDORVUCEZ
GQTWJSPBHANMXYFLKIDORVUCEZ
ZGQTWJSPBHANMXYFLKIDORVUCE
...

Test 5

Verdict:

input
BJYNFLKEIUCZMQHRAXOGWPSDTV

correct output
624
MOVE
SWAP
MOVE
SWAP
...

user output
VBJYNFLKEIUCZMQHRAXOGWPSDT
BVJYNFLKEIUCZMQHRAXOGWPSDT
TBVJYNFLKEIUCZMQHRAXOGWPSD
BTVJYNFLKEIUCZMQHRAXOGWPSD
DBTVJYNFLKEIUCZMQHRAXOGWPS
...