제출 #1187571

#제출 시각아이디문제언어결과실행 시간메모리
1187571weakweakweakLaugh Analysis (IOI16_laugh)C++20
100 / 100
2 ms584 KiB
#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' or s[i] == 'h') { int j = i; while (j+1 < n and s[j+1] != s[j] and (s[j+1] == 'a' or s[j+1] == 'h')) j++; ans = max(ans, j-i+1); i = j; } } return ans; }

컴파일 시 표준 에러 (stderr) 메시지

laugh.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
laugh_c.h:1:9: warning: #pragma once in main file
    1 | #pragma once
      |         ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...