Submission #162408


Source Code Expand

#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
#define max(x, y)	(((x) > (y))? (x) : (y))
#define abs(x)		(((x) < 0)? (-1*(x)) : (x))

//int dp[10000][10000];
string s;
int n;

using namespace std;

int main() {
//	memset(dp, -1, sizeof(dp));

	cin >> s;

	if (s == "a") cout << -1 << endl;
	else {
		if ((n = s.size()) == 1) s[0] = s[0] - 1;
		else s = s.substr(0, n - 1);
	}
	
	cout << s << endl;

	return 0;
}

Submission Info

Submission Time
Task B - 辞書式順序
User ericode
Language C++ (G++ 4.6.4)
Score 0
Code Size 473 Byte
Status CE

Compile Error

./Main.cpp:9:1: error: ‘string’ does not name a type
./Main.cpp: In function ‘int main()’:
./Main.cpp:17:9: error: ‘s’ was not declared in this scope