結果
問題 | No.1292 パタパタ三角形 |
ユーザー |
![]() |
提出日時 | 2020-11-20 22:22:03 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 171 ms / 2,000 ms |
コード長 | 1,380 bytes |
コンパイル時間 | 440 ms |
コンパイル使用メモリ | 82,120 KB |
実行使用メモリ | 121,080 KB |
最終ジャッジ日時 | 2024-07-23 13:18:11 |
合計ジャッジ時間 | 2,479 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
import sysdef S(): return sys.stdin.readline().rstrip()S = S()ANS = set()state = 1a,b,c = 0,0,0ANS.add((a,b,c))for s in S:if state == 1:if s == 'a':state = 2a += 1elif s == 'b':state = 3b += 1else:state = 4c += 1elif state == 2:if s == 'a':state = 1a += -1elif s == 'b':state = 5c += -1else:state = 6b += -1elif state == 3:if s == 'a':state = 6c += -1elif s == 'b':state = 1b += -1else:state = 5a += -1elif state == 4:if s == 'a':state = 5b += -1elif s == 'b':state = 6a += -1else:state = 1c += -1elif state == 5:if s == 'a':state = 4b += 1elif s == 'b':state = 2c += 1else:state = 3a += 1else:if s == 'a':state = 3c += 1elif s == 'b':state = 4a += 1else:state = 2b += 1ANS.add((a,b,c))print(len(ANS))