CSES - Datatähti 2018 loppu - Results
Submission details
Task:Merkkijono
Sender:nokka7
Submission time:2018-01-18 13:24:21 +0200
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#20.04 sdetails
#30.05 sdetails
#40.04 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;
			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
CABZYXWVUTSRQPONMLKJIHGFED
DACBZYXWVUTSRQPONMLKJIHGFE
EADCBZYXWVUTSRQPONMLKJIHGF
...

Test 3

Verdict:

input
RPJMFWBHYQOTXUAENLDGZISCVK

correct output
611
SWAP
MOVE
MOVE
SWAP
...

user output
KPRJMFWBHYQOTXUAENLDGZISCV
VKPRJMFWBHYQOTXUAENLDGZISC
CKVPRJMFWBHYQOTXUAENLDGZIS
SCKVPRJMFWBHYQOTXUAENLDGZI
ICSKVPRJMFWBHYQOTXUAENLDGZ
...

Test 4

Verdict:

input
GWJSPBHANMXYFLKIDORVUCEZQT

correct output
659
MOVE
SWAP
MOVE
SWAP
...

user output
TGWJSPBHANMXYFLKIDORVUCEZQ
QGTWJSPBHANMXYFLKIDORVUCEZ
ZGQTWJSPBHANMXYFLKIDORVUCE
EZGQTWJSPBHANMXYFLKIDORVUC
CEZGQTWJSPBHANMXYFLKIDORVU
...

Test 5

Verdict:

input
BJYNFLKEIUCZMQHRAXOGWPSDTV

correct output
624
MOVE
SWAP
MOVE
SWAP
...

user output
VBJYNFLKEIUCZMQHRAXOGWPSDT
TBVJYNFLKEIUCZMQHRAXOGWPSD
DBTVJYNFLKEIUCZMQHRAXOGWPS
SBDTVJYNFLKEIUCZMQHRAXOGWP
PBSDTVJYNFLKEIUCZMQHRAXOGW
...