Submission #6402305


Source Code Expand

#include <iostream>
#include <string>
#include <cstring>
using namespace std;

int main() {
	int n,ans;
	string m;
	string a[16]={"AA","BB","XX","YY","AB","AX","AY","BA","BX","BY","XA","XB","XY","YA","YB","YX"};
	cin >> n >> m;
	ans=n;
	for ( int i=0;i<16;i++) {
		for ( int j=0;i<16;i++) {
			string L=a[i],R=a[j],blom=s;
			while (blom.find(L)!=-1) {
				blom.replace(blom.find(L),2,"L");
			}
			while (blom.find(R)!=-1) {
				blom.replace(blom.find(R),2,"L");
			}
			if (blom.length()<ans) {
				ans=blom.length();
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Submission Info

Submission Time
Task C - コマンド入力
User luogu_bot5
Language C++ (GCC 5.4.1)
Score 0
Code Size 593 Byte
Status CE

Compile Error

./Main.cpp: In function ‘int main()’:
./Main.cpp:14:30: error: ‘s’ was not declared in this scope
    string L=a[i],R=a[j],blom=s;
                              ^