結果
問題 | No.1016 三目並べ |
ユーザー |
![]() |
提出日時 | 2020-04-06 18:32:25 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,087 bytes |
コンパイル時間 | 1,875 ms |
コンパイル使用メモリ | 121,388 KB |
最終ジャッジ日時 | 2025-01-09 14:44:54 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 9 |
ソースコード
#include <functional> #include <algorithm> #include <iostream> #include <iomanip> #include <cstring> #include <string> #include <vector> #include <random> #include <bitset> #include <queue> #include <cmath> #include <stack> #include <set> #include <map> typedef long long ll; using namespace std; const ll MOD = 1000000007LL; int main() { cin.sync_with_stdio(false); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int n; string s; cin >> n >> s; bool win = false; for (int i = 0; i < n - 2; i++) { string str = s.substr(i, 3); if (str == "ooo") win = true; if (str == "o-o") win = true; if (str == "oo-") win = true; if (str == "-oo") win = true; } for (int i = 0; i < n - 4; i++) { string str = s.substr(i, 5); if (str == "o---o") win = true; if (str == "o--o-") win = true; if (str == "-o--o") win = true; } cout << (win ? 'O' : 'X') << endl; } return 0; }