結果
| 問題 |
No.2021 Not A but B
|
| コンテスト | |
| ユーザー |
👑 SPD_9X2
|
| 提出日時 | 2022-07-29 21:34:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 240 bytes |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 66,304 KB |
| 最終ジャッジ日時 | 2024-07-19 13:22:15 |
| 合計ジャッジ時間 | 2,432 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 2 |
| other | AC * 8 WA * 18 |
ソースコード
import sys
from sys import stdin
N = int(stdin.readline())
bb = 0
other = 0
S = stdin.readline()[:-1]
for i in range(N-1):
if S[i]+S[i+1] == "BB":
bb += 1
else:
other += 1
ans = other + min(bb,1)
print (ans)
SPD_9X2