Submission #52331539


Source Code Expand

Copy
#include<bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
#define endl '\n'
using namespace std;
string s,t;
int n,flag;
bool ff;
int C2c(char ch){ return ch - 'A' + 'a'; }
int main(){
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
cin>>s>>t;
int n = s.size();
if(t[2] != 'X'){
ff = 0;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include<bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
#define endl '\n'
using namespace std;

string s,t;
int n,flag;
bool ff;

int C2c(char ch){ return ch - 'A' + 'a'; }

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	
	cin>>s>>t;
	int n = s.size();
	
	if(t[2] != 'X'){
		ff = 0;
		for(int i=0;i<n;i++){
			if(s[i] == C2c(t[0])){
				flag = i;
				ff = 1;
				break;
			}
		}
		if(!ff){
			cout<<"No";
			return 0;
		}
		ff = 0;
		for(int i=flag+1;i<n;i++){
			if(s[i] == C2c(t[1])){
				flag = i;
				ff = 1;
				break;
			}
		}
		if(!ff){
			cout<<"No";
			return 0;
		}
		ff = 0;
		for(int i=flag+1;i<n;i++){
			if(s[i] == C2c(t[2])){
				flag = i;
				ff = 1;
				break;
			}
		}
		if(!ff){
			cout<<"No";
			return 0;
		}
		cout<<"Yes";
	}
	
	else{
		ff = 0;
		for(int i=0;i<n;i++){
			if(s[i] == C2c(t[0])){
				flag = i;
				ff = 1;
				break;
			}
		}
		if(!ff){
			cout<<"No";
			return 0;
		}
		ff = 0;
		for(int i=flag+1;i<n;i++){
			if(s[i] == C2c(t[1])){
				flag = i;
				ff = 1;
				break;
			}
		}
		if(!ff){
			cout<<"No";
			return 0;
		}
		cout<<"Yes";
	}
	return 0;
}

Submission Info

Submission Time
Task C - Airport Code
User wusixie
Language C++ 20 (gcc 12.2)
Score 300
Code Size 1208 Byte
Status AC
Exec Time 1 ms
Memory 3688 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 48
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, 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
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 3508 KB
00_sample_02.txt AC 1 ms 3504 KB
00_sample_03.txt AC 1 ms 3440 KB
01_random_01.txt AC 1 ms 3404 KB
01_random_02.txt AC 1 ms 3472 KB
01_random_03.txt AC 1 ms 3504 KB
01_random_04.txt AC 1 ms 3572 KB
01_random_05.txt AC 1 ms 3512 KB
01_random_06.txt AC 1 ms 3508 KB
01_random_07.txt AC 1 ms 3524 KB
01_random_08.txt AC 1 ms 3572 KB
01_random_09.txt AC 1 ms 3504 KB
01_random_10.txt AC 1 ms 3408 KB
01_random_11.txt AC 1 ms 3508 KB
01_random_12.txt AC 1 ms 3488 KB
01_random_13.txt AC 1 ms 3428 KB
01_random_14.txt AC 1 ms 3432 KB
01_random_15.txt AC 1 ms 3500 KB
01_random_16.txt AC 1 ms 3624 KB
01_random_17.txt AC 1 ms 3504 KB
01_random_18.txt AC 1 ms 3408 KB
01_random_19.txt AC 1 ms 3512 KB
01_random_20.txt AC 1 ms 3628 KB
01_random_21.txt AC 1 ms 3504 KB
01_random_22.txt AC 1 ms 3404 KB
01_random_23.txt AC 1 ms 3504 KB
01_random_24.txt AC 1 ms 3428 KB
01_random_25.txt AC 1 ms 3512 KB
01_random_26.txt AC 1 ms 3560 KB
01_random_27.txt AC 1 ms 3496 KB
01_random_28.txt AC 1 ms 3564 KB
01_random_29.txt AC 1 ms 3508 KB
01_random_30.txt AC 1 ms 3636 KB
02_handmade_01.txt AC 1 ms 3488 KB
02_handmade_02.txt AC 1 ms 3540 KB
02_handmade_03.txt AC 1 ms 3556 KB
02_handmade_04.txt AC 1 ms 3564 KB
02_handmade_05.txt AC 1 ms 3424 KB
02_handmade_06.txt AC 1 ms 3600 KB
02_handmade_07.txt AC 1 ms 3688 KB
02_handmade_08.txt AC 1 ms 3632 KB
02_handmade_09.txt AC 1 ms 3632 KB
02_handmade_10.txt AC 1 ms 3640 KB
02_handmade_11.txt AC 1 ms 3488 KB
02_handmade_12.txt AC 1 ms 3404 KB
02_handmade_13.txt AC 1 ms 3484 KB
02_handmade_14.txt AC 1 ms 3560 KB
02_handmade_15.txt AC 1 ms 3436 KB


2025-03-31 (Mon)
05:32:24 +00:00