結果

問題 No.1016 三目並べ
ユーザー hiikunZhiikunZ
提出日時 2021-07-18 11:03:52
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 942 bytes
コンパイル時間 2,231 ms
コンパイル使用メモリ 205,908 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-22 12:31:29
合計ジャッジ時間 3,254 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#include <atcoder/twosat>
using namespace std;
using namespace atcoder;
using ll = long long int;
using ld = long double;
const ll MAX = 5000000000000000000;
const ld PI = 3.14159265358979;
const ll MOD = 0;//2024948111;
ld dotorad(ld K){return PI * K / 180.0;}
ld radtodo(ld K){return K * 180.0 / PI;}
mt19937 mt;
void randinit(){srand((unsigned)time(NULL));mt = mt19937(rand());}
int main(){
    ll T;
    cin >> T;
    for(ll t = 0;t < T;t++){
        ll N;
        char ans = 'X';
        string S;
        cin >> N >> S;
        for(ll i = 0;i < N - 2;i++){
            if(S[i] == 'o' && S[i + 1] == 'o' && S[i + 2] == 'o') ans = 'O';
            if(S[i] == 'o' && S[i + 1] == '-' && S[i + 2] == 'o') ans = 'O';
            if(S[i] == 'o' && S[i + 1] == 'o' && S[i + 2] == '-') ans = 'O';
            if(S[i] == '-' && S[i + 1] == 'o' && S[i + 2] == 'o') ans = 'O';
        }
        cout << ans << endl;
    }
}
0