結果
問題 |
No.1016 三目並べ
|
ユーザー |
|
提出日時 | 2022-04-24 19:08:00 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 981 bytes |
コンパイル時間 | 3,001 ms |
コンパイル使用メモリ | 249,732 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 05:59:39 |
合計ジャッジ時間 | 3,730 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 WA * 5 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define ll long long #define all(x) x.begin(),x.end() #define ar array #define sz(x) ((int)x.size()) template <class T,class S> inline bool chmin(T &a,const S &b) {return (a> b? a= b, 1: 0);} template <class T,class S> inline bool chmax(T &a,const S &b) {return (a< b? a= b, 1: 0);} int main(){ ios_base::sync_with_stdio(false),cin.tie(0); int t; cin >> t; while(t--){ int n; string s; cin >> n >> s; // o-o // ooo // oo- // -oo //-o-- -oo- xoo- // --o- vector <string> arr; arr.push_back("o-o"); arr.push_back("ooo"); arr.push_back("oo-"); arr.push_back("-oo"); arr.push_back("-o--"); arr.push_back("--o-"); bool ok = false; for(auto ele: arr) if(s.find(ele) != s.npos) ok = true; cout << (ok ? "O" : "X") << "\n"; } return 0; }