結果
問題 | No.1292 パタパタ三角形 |
ユーザー |
![]() |
提出日時 | 2020-11-26 00:03:21 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 136 ms / 2,000 ms |
コード長 | 1,103 bytes |
コンパイル時間 | 531 ms |
コンパイル使用メモリ | 82,808 KB |
実行使用メモリ | 115,180 KB |
最終ジャッジ日時 | 2024-07-23 19:33:51 |
合計ジャッジ時間 | 2,299 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 14 |
ソースコード
def p2(data):inputs=list(data)ref = 0x=0y=0inv=0history = set()history.add((x,y))for _in in inputs:if 0==ref:if _in == 'a':if inv:y+=1else:y-=1elif _in == 'b':x+=1ref=2else:x-=1ref=1elif 1==ref:if _in == 'b':if inv:y+=1else:y-=1elif _in == 'c':x+=1ref=0else:x-=1ref=2else:if _in == 'c':if inv:y+=1else:y-=1elif _in == 'a':x+=1ref=1else:x-=1ref=0history.add((x,y))inv^=1print(len(history))from sys import stdininput = stdin.readlinep2(list(input().rstrip()))