Submission #832894

# Submission time Handle Problem Language Result Execution time Memory
832894 2023-08-21T16:26:17 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;
	string cur = "";
	for (int i = 0; i < n; i++) {
		if ((s[i] != 'a' && s[i] != 'h') || (cur.size() && s[i] == cur.back())) {
			ans = max(ans, (int)cur.size());
			cur.clear();
		}
		else
			cur += s[i];
	}
	ans = max(ans, (int)cur.size());
	return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB numbers differ - expected: '2', found: '1'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB numbers differ - expected: '2', found: '1'
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB numbers differ - expected: '2', found: '1'
3 Halted 0 ms 0 KB -