結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2018-11-06 21:57:05 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 29 ms / 2,000 ms |
コード長 | 525 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-11-20 20:36:28 |
合計ジャッジ時間 | 1,933 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
if __name__ == '__main__':s = input()judge = 0east = 0west = 0i = 0while i < len(s):if s[i] == 'O':east += 1west = 0elif s[i] == 'X':east = 0west += 1if east == 3 or west == 3:judge = 1 if east == 3 else -1breaki+=1if len(s) < 3:judge = 0if judge > 0:print('East')elif judge < 0:print('West')else:print('NA')