結果

問題 No.486 3 Straight Win(3連勝)
ユーザー lam6er
提出日時 2025-03-26 15:43:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,248 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2025-03-26 15:44:06
合計ジャッジ時間 2,261 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #

s = input().strip()
current_east = 0
current_west = 0
winner = None

for c in s:
    if c == 'O':
        current_east += 1
        current_west = 0
    else:
        current_west += 1
        current_east = 0
    
    if current_east >= 3 or current_west >= 3:
        winner = 'East' if current_east >= 3 else 'West'
        break

print(winner if winner is not None else 'NA')
0