結果
| 問題 |
No.2738 CPC To F
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-04-20 10:52:58 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 450 bytes |
| コンパイル時間 | 220 ms |
| コンパイル使用メモリ | 82,496 KB |
| 実行使用メモリ | 76,352 KB |
| 最終ジャッジ日時 | 2024-10-12 06:28:27 |
| 合計ジャッジ時間 | 2,239 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | WA * 22 |
ソースコード
def maxConsecutiveStrings(S: str) -> int:
n = len(S)
last_c = None
count = 0
max_count = 0
for i in range(n):
if S[i] == 'C':
if last_c == 'T':
count -= 1
count += 1
else:
last_c = S[i]
if S[i] == 'F':
max_count = max(max_count, count)
count = 0
return max_count
N = int(input())
s = input()
print(maxConsecutiveStrings(s))