結果
問題 |
No.2021 Not A but B
|
ユーザー |
![]() |
提出日時 | 2024-11-18 22:06:08 |
言語 | Go (1.23.4) |
結果 |
WA
|
実行時間 | - |
コード長 | 265 bytes |
コンパイル時間 | 10,627 ms |
コンパイル使用メモリ | 236,872 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-18 22:06:25 |
合計ジャッジ時間 | 15,101 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 1 |
other | AC * 6 WA * 20 |
ソースコード
package main import . "fmt" import . "strings" func main() { var n,s string Scan(&n,&s) b:=[]byte(s) var c int if Contains(s,"BB") { c++ } for i,x:=range b[1:] { y:=b[i] if x=='A'||y=='A' { c++ if x!=y { b[i+1]='B' } } } Println(c) }