結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2017-08-16 11:21:12 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 508 bytes |
コンパイル時間 | 106 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-06-26 04:31:45 |
合計ジャッジ時間 | 1,916 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
#OまたはXが3連続で続いたら勝敗が確定する OならEast XならWest それ以外はNA S = input() #両方含まれていない if 'OOO' not in S and 'XXX' not in S: print('NA') #OOOがあるがXXXがない elif 'OOO' in S and 'XXX' not in S: print('East') #XXXがあるがOOOがない elif 'XXX' in S and 'OOO' not in S: print('West') #両方含まれている場合、先に出現した方を出力する elif S.index('XXX') < S.index('OOO'): print('West') else: print('East')