結果
問題 |
No.1016 三目並べ
|
ユーザー |
|
提出日時 | 2020-04-05 20:41:30 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 730 bytes |
コンパイル時間 | 1,944 ms |
コンパイル使用メモリ | 193,916 KB |
最終ジャッジ日時 | 2025-01-09 14:23:54 |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 10 |
ソースコード
#define _USE_MATH_DEFINES #include <bits/stdc++.h> using namespace std; signed main() { ios::sync_with_stdio(false); cin.tie(0); auto solve = [] () { int n; cin >> n; string s; cin >> s; for (int i = 0; i + 2 < n; i++) { if (s.substr(i, 3) == "ooo") return "O\n"; } for (int i = 0; i < n; i++) { if (s[i] == '-') { s[i] = 'o'; for (int j = max(0, i - 2); j <= i; j++) { if (s.substr(j, 3) == "ooo") return "O\n"; } for (int j = max(0, i - 3); j <= i; j++) { if (s.substr(j, 4) == "_oo_") return "O\n"; } s[i] = '-'; } } return "X\n"; }; int t; cin >> t; while (t--) cout << solve(); return 0; }