結果
問題 |
No.486 3 Straight Win(3連勝)
|
ユーザー |
![]() |
提出日時 | 2021-03-09 00:12:13 |
言語 | TypeScript (5.7.2) |
結果 |
AC
|
実行時間 | 64 ms / 2,000 ms |
コード長 | 506 bytes |
コンパイル時間 | 7,776 ms |
コンパイル使用メモリ | 228,996 KB |
実行使用メモリ | 39,424 KB |
最終ジャッジ日時 | 2024-12-31 16:33:01 |
合計ジャッジ時間 | 10,617 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
import * as fs from 'fs'; const input = fs.readFileSync('/dev/stdin', 'utf8'); const OXarray = input.split(''); let ans = null; if (OXarray.length <= 2) { ans = 'NA'; } for (let i = 0;i < OXarray.length - 2; i++) { if (OXarray[i] === OXarray[i + 1] && OXarray[i] === OXarray[i + 2]) { if (OXarray[i] === 'O') { ans = 'East'; } else if (OXarray[i] === 'X') { ans = 'West'; } break; } else { ans = 'NA'; } } console.log(ans);