답안 #832870

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
832870 2023-08-21T16:07:27 Z DarkMatter Laugh Analysis (IOI16_laugh) C++14
0 / 100
0 ms 212 KB
#include "laugh.h"
#include<bits/stdc++.h>

using namespace std;

int longest_laugh(std::string s)
{
	int n = s.size();
	int ans = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] != 'a' && s[i] != 'h')
			continue;
		string cur = "";
		for (int j = i; j < n; j++) {
			if (s[j] != 'a' && s[j] != 'h')
				break;
			if (cur.empty() || cur.back() != s[j])
				cur += s[j];
			else
				break;
		}
		ans = max(ans, (int)cur.size());
	}
	cout << ans << endl;
	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Extra information in the output file
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Extra information in the output file
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Extra information in the output file
2 Halted 0 ms 0 KB -