結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
![]() |
提出日時 | 2022-08-08 21:36:48 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 31 ms / 2,000 ms |
コード長 | 551 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-19 06:05:15 |
合計ジャッジ時間 | 2,115 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
import sysreadline=sys.stdin.readlinedef Run_Length(lst):run_length=[]if lst:prev=lst[0]cnt=1for x in lst[1:]:if x==prev:cnt+=1else:run_length.append((prev,cnt))prev=xcnt=1run_length.append((prev,cnt))return run_lengthS=readline().rstrip()for s,c in Run_Length(S):if c>=3:if s=="O":ans="East"else:ans="West"breakelse:ans="NA"print(ans)