Submission #65247521


Source Code Expand

#include<iostream>
#include<vector>
using namespace std;

int main() {
    string s, t; cin >> s >> t;
    bool f = false;
    for(int i = 0; i < s.size(); i++) {
        int j = 0;
        while(j < t.size() && i + j < s.size() && (s[i + j] == t[j] || s[i + j] == '?')) j++;
        if(j == t.size()) f = true;
    }

    if(f) cout << "Yes\n";
    else cout << "No\n";
}

Submission Info

Submission Time
Task B - Four Hidden
User sivasaran2003
Language C++ 17 (gcc 12.2)
Score 250
Code Size 387 Byte
Status AC
Exec Time 1 ms
Memory 3564 KiB

Compile Error

Main.cpp: In function ‘int main()’:
Main.cpp:8:22: 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 < s.size(); i++) {
      |                    ~~^~~~~~~~~~
Main.cpp:10:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   10 |         while(j < t.size() && i + j < s.size() && (s[i + j] == t[j] || s[i + j] == '?')) j++;
      |               ~~^~~~~~~~~~
Main.cpp:10:37: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   10 |         while(j < t.size() && i + j < s.size() && (s[i + j] == t[j] || s[i + j] == '?')) j++;
      |                               ~~~~~~^~~~~~~~~~
Main.cpp:11:14: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
   11 |         if(j == t.size()) f = true;
      |            ~~^~~~~~~~~~~

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 250 / 250
Status
AC × 3
AC × 25
Set Name Test Cases
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
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3564 KiB
00_sample_02.txt AC 1 ms 3444 KiB
00_sample_03.txt AC 1 ms 3564 KiB
01_random_01.txt AC 1 ms 3436 KiB
01_random_02.txt AC 1 ms 3472 KiB
01_random_03.txt AC 1 ms 3560 KiB
01_random_04.txt AC 1 ms 3528 KiB
01_random_05.txt AC 1 ms 3484 KiB
01_random_06.txt AC 1 ms 3520 KiB
01_random_07.txt AC 1 ms 3464 KiB
01_random_08.txt AC 1 ms 3516 KiB
01_random_09.txt AC 1 ms 3364 KiB
01_random_10.txt AC 1 ms 3392 KiB
01_random_11.txt AC 1 ms 3464 KiB
01_random_12.txt AC 1 ms 3512 KiB
01_random_13.txt AC 1 ms 3492 KiB
01_random_14.txt AC 1 ms 3468 KiB
01_random_15.txt AC 1 ms 3364 KiB
01_random_16.txt AC 1 ms 3520 KiB
01_random_17.txt AC 1 ms 3524 KiB
01_random_18.txt AC 1 ms 3488 KiB
01_random_19.txt AC 1 ms 3460 KiB
01_random_20.txt AC 1 ms 3532 KiB
02_handmade_01.txt AC 1 ms 3528 KiB
02_handmade_02.txt AC 1 ms 3364 KiB