Burger Stand (UVA 13048) by aizu_f
Contest: 3738    RunID: 20173578    Status: Wrong answer    Date: Sat Oct 14 13:48:41 JST 2017


#include <bits/stdc++.h>
#include<set>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<stdio.h>
#define INF 100000000
#include<map>
using namespace std;
map<int, int> mp;


int main() {
	int n, caseT = 0;
	char s[2014];
	scanf("%d", &n);
	while(n--){
		scanf("%s", &s);
		int len = strlen(s); int res = -1;
		for(int i = 0; i < len; i++){
			int type = i ? s[i -1] : 0, cnt = 1;
			if(type == '=' || type == '-'){
				for(int j = i - 1; j >= 0 && s[j] == type; j--){
					cnt++;
				}
			res = max(res, cnt);
			}else if(s[i] == '<'){
				int type = s[i + 1], cnt = 1;
				if(type == '=' || type == '-')
					for(int j = i + 1; s[j] && s[j] == type; j++) cnt++;
				res = max(res, cnt);
			}
		}
		printf("Case %d: %d\n", ++caseT, res);

	}
	return 0;
}