| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1323953 | kasamchi | Laugh Analysis (IOI16_laugh) | C++20 | 2 ms | 568 KiB |
#include "laugh.h"
#include <bits/stdc++.h>
using namespace std;
int longest_laugh(string s) {
int N = s.size();
int ans = 0;
for (int i = 0; i < N; ) {
if (s[i] == 'a') {
int j = i;
while (j < N && (((j - i) % 2 == 0 && s[j] == 'a') || ((j - i) % 2 == 1 && s[j] == 'h'))) {
j++;
}
ans = max(ans, j - i);
i = j;
} else if (s[i] == 'h') {
int j = i;
while (j < N && (((j - i) % 2 == 0 && s[j] == 'h') || ((j - i) % 2 == 1 && s[j] == 'a'))) {
j++;
}
ans = max(ans, j - i);
i = j;
} else {
i++;
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
