提出 #65217735


ソースコード 拡げる

#include <bits/stdc++.h>
using namespace std;

int main() {
    string T, U;
    cin >> T >> U;
    vector<int> indices;
    for (int i = 0; i < T.size(); i++) {
        if (T[i] == '?') {
            indices.push_back(i);
        }
    }
    vector<char> alphabets(26);
    for (int i = 0; i < 26; i++) {
        alphabets[i] = 'a' + i;
    }
    for (char a : alphabets) {
        for (char b : alphabets) {
            for (char c : alphabets) {
                for (char d : alphabets) {
                    string S = T;
                    S[indices[0]] = a;
                    S[indices[1]] = b;
                    S[indices[2]] = c;
                    S[indices[3]] = d;
                    if (S.find(U) != string::npos) {
                        cout << "Yes" << endl;
                        return 0;
                    }
                }
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

提出情報

提出日時
問題 B - Four Hidden
ユーザ sotanishy
言語 C++ 20 (gcc 12.2)
得点 250
コード長 962 Byte
結果 AC
実行時間 14 ms
メモリ 3660 KiB

コンパイルエラー

Main.cpp: In function ‘int main()’:
Main.cpp:8:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
    8 |     for (int i = 0; i < T.size(); i++) {
      |                     ~~^~~~~~~~~~

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 250 / 250
結果
AC × 3
AC × 25
セット名 テストケース
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 02_handmade_01.txt, 02_handmade_02.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 1 ms 3656 KiB
00_sample_02.txt AC 8 ms 3500 KiB
00_sample_03.txt AC 1 ms 3568 KiB
01_random_01.txt AC 12 ms 3476 KiB
01_random_02.txt AC 3 ms 3564 KiB
01_random_03.txt AC 5 ms 3500 KiB
01_random_04.txt AC 9 ms 3468 KiB
01_random_05.txt AC 14 ms 3436 KiB
01_random_06.txt AC 1 ms 3468 KiB
01_random_07.txt AC 1 ms 3660 KiB
01_random_08.txt AC 1 ms 3568 KiB
01_random_09.txt AC 10 ms 3460 KiB
01_random_10.txt AC 1 ms 3444 KiB
01_random_11.txt AC 9 ms 3540 KiB
01_random_12.txt AC 1 ms 3572 KiB
01_random_13.txt AC 2 ms 3464 KiB
01_random_14.txt AC 6 ms 3500 KiB
01_random_15.txt AC 6 ms 3436 KiB
01_random_16.txt AC 9 ms 3472 KiB
01_random_17.txt AC 1 ms 3568 KiB
01_random_18.txt AC 6 ms 3504 KiB
01_random_19.txt AC 3 ms 3656 KiB
01_random_20.txt AC 1 ms 3536 KiB
02_handmade_01.txt AC 8 ms 3472 KiB
02_handmade_02.txt AC 1 ms 3460 KiB