제출 #1124370

#제출 시각아이디문제언어결과실행 시간메모리
1124370caf_sqLaugh Analysis (IOI16_laugh)C++20
100 / 100
3 ms840 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; int longest_laugh(string S) { string t; int ans = 0; for(auto &i : S) { if(i == 'a') { if(t.empty() || t.back() == 'h') { t += 'a'; } else { t = "a"; } } else if(i == 'h') { if(t.empty() || t.back() == 'a') { t += 'h'; } else { t = "h"; } } else { t.clear(); } ans = max(ans, (int)t.size()); } 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...