提出 #52401939


ソースコード 拡げる

// WEBLINK

#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <queue>

using namespace std;

using ll = long long;
using ii = pair<int, int>;
using iii = pair<ii, int>;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vii = vector<ii>;

#define pb push_back
#define fst first
#define snd second
#define all(x) (x).begin,(x).end()
#define rall(x) (x).rbegin,(x).rend()

// ------------- SORT -------------------

template<class T> void SORT(vector<T> & a) { sort(a.begin(), a.end()); }
template<class T> void RSORT(vector<T> & a) { sort(a.rbegin(), a.rend()); }

// ------------- INPUT -------------------

template<class T> void inp(T & x) { cin >> x; }
template<class T> void inp(vector<T> & t) { for (auto && x : t) cin >> x; }

// ---------- MOD --------------------
const int mod = 1000000007;

void add(int & x, int y) {
	x += y;
	if (x < 0) x += mod;
	if (x >= mod) x -= mod;
}
int add2(int x, int y) {
	x += y;
	if (x < 0) x += mod;
	if (x >= mod) x -= mod;
	return x;
}

int mul(int x, int y) {ll r = x; r *= y; return r % mod;}

int power(int x, int p) {
	if (x < 0 or p < 0) return 0;
	int r = 1;
	while (p > 0)
	{
		if (p & 1) r = mul(r, x);
		x = mul(x, x); p /= 2;
	} return r;
}
int inv(int a) { return power(a, mod - 2); }

// ------------- MINMAX -------------------

template<typename T, typename T1>T amax(T &a, T1 b) {if (b > a)a = b; return a;}
template<typename T, typename T1>T amin(T &a, T1 b) {if (b < a)a = b; return a;}

// ----------- MATHS ------------

ll sq(int x) { ll r = x; return r * r; }

// ---------- DEBUG --------------------

//#define ON_PC
#ifdef ON_PC
#include </Users/karanaggarwal/code/debug.h>
#else
#define deb(x...)
#endif

///////////////////////////////////


bool f()
{
    string S, T;
    cin >> S >> T;
    int i = 0, j = 0;
    int n = S.size();
    int m = T.size();
    if (T[m-1] == 'X') m--;
    
    for (;i<n and j < m; j++)
    {
        while (i < n and S[i] + ('A'-'a') != T[j])
            i++;
    }
    return (i < n);
}


void solve()
{
    if (f()) cout << "Yes" << endl;
    else cout << "No" << endl;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int t = 1;
	// cin >> t;
	while (t--)
	{
		solve();
	}

	return 0;
}

提出情報

提出日時
問題 C - Airport Code
ユーザ karanaggarwal
言語 C++ 20 (gcc 12.2)
得点 0
コード長 2433 Byte
結果 WA
実行時間 1 ms
メモリ 3784 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 0 / 300
結果
AC × 3
AC × 45
WA × 3
セット名 テストケース
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, 01_random_21.txt, 01_random_22.txt, 01_random_23.txt, 01_random_24.txt, 01_random_25.txt, 01_random_26.txt, 01_random_27.txt, 01_random_28.txt, 01_random_29.txt, 01_random_30.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt, 02_handmade_05.txt, 02_handmade_06.txt, 02_handmade_07.txt, 02_handmade_08.txt, 02_handmade_09.txt, 02_handmade_10.txt, 02_handmade_11.txt, 02_handmade_12.txt, 02_handmade_13.txt, 02_handmade_14.txt, 02_handmade_15.txt
ケース名 結果 実行時間 メモリ
00_sample_01.txt AC 1 ms 3536 KiB
00_sample_02.txt AC 1 ms 3532 KiB
00_sample_03.txt AC 1 ms 3452 KiB
01_random_01.txt AC 1 ms 3424 KiB
01_random_02.txt AC 1 ms 3396 KiB
01_random_03.txt AC 1 ms 3528 KiB
01_random_04.txt AC 1 ms 3652 KiB
01_random_05.txt AC 1 ms 3420 KiB
01_random_06.txt AC 1 ms 3608 KiB
01_random_07.txt WA 1 ms 3456 KiB
01_random_08.txt AC 1 ms 3504 KiB
01_random_09.txt AC 1 ms 3400 KiB
01_random_10.txt AC 1 ms 3420 KiB
01_random_11.txt AC 1 ms 3532 KiB
01_random_12.txt AC 1 ms 3656 KiB
01_random_13.txt AC 1 ms 3444 KiB
01_random_14.txt AC 1 ms 3456 KiB
01_random_15.txt AC 1 ms 3532 KiB
01_random_16.txt AC 1 ms 3444 KiB
01_random_17.txt AC 1 ms 3528 KiB
01_random_18.txt AC 1 ms 3604 KiB
01_random_19.txt AC 1 ms 3476 KiB
01_random_20.txt AC 1 ms 3532 KiB
01_random_21.txt AC 1 ms 3416 KiB
01_random_22.txt AC 1 ms 3600 KiB
01_random_23.txt AC 1 ms 3396 KiB
01_random_24.txt AC 1 ms 3528 KiB
01_random_25.txt AC 1 ms 3444 KiB
01_random_26.txt AC 1 ms 3704 KiB
01_random_27.txt AC 1 ms 3572 KiB
01_random_28.txt AC 1 ms 3656 KiB
01_random_29.txt AC 1 ms 3664 KiB
01_random_30.txt AC 1 ms 3780 KiB
02_handmade_01.txt AC 1 ms 3584 KiB
02_handmade_02.txt AC 1 ms 3580 KiB
02_handmade_03.txt AC 1 ms 3728 KiB
02_handmade_04.txt AC 1 ms 3784 KiB
02_handmade_05.txt AC 1 ms 3556 KiB
02_handmade_06.txt AC 1 ms 3576 KiB
02_handmade_07.txt AC 1 ms 3636 KiB
02_handmade_08.txt AC 1 ms 3660 KiB
02_handmade_09.txt WA 1 ms 3660 KiB
02_handmade_10.txt WA 1 ms 3728 KiB
02_handmade_11.txt AC 1 ms 3592 KiB
02_handmade_12.txt AC 1 ms 3528 KiB
02_handmade_13.txt AC 1 ms 3532 KiB
02_handmade_14.txt AC 1 ms 3588 KiB
02_handmade_15.txt AC 1 ms 3596 KiB