結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2020-02-07 08:41:28 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 34 ms / 2,000 ms |
コード長 | 346 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,624 KB |
最終ジャッジ日時 | 2024-09-25 07:12:50 |
合計ジャッジ時間 | 1,940 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
s = input()e = "OOO"w = "XXX"NO_STRAIGHT_WIN = 1000def f(word, pat):win = word.find(pat)if win == -1:win = NO_STRAIGHT_WINreturn winwin_e = f(s, e)win_w = f(s, w)if win_e == NO_STRAIGHT_WIN and win_w == NO_STRAIGHT_WIN:ans = "NA"elif win_e < win_w:ans = "East"else:ans = "West"print(ans)