# |
Author |
Problem |
Lang |
Verdict |
Time |
Memory |
Sent |
Judged |
|
38304227 |
Practice:
sankalp_ |
265A
- 20
|
C++14 (GCC 6-32)
|
Accepted
|
30 ms
|
3284 KB
|
2018-05-16 02:06:56 |
2018-05-16 02:06:56 |
|
/*
#####################################################
# I will win.. maybe not immediately but definitely #
#####################################################
*/
#include <bits/stdc++.h>
using namespace std;
//Optimizations
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//save time
#define endl '\n'
typedef long long ll;
//for sorting
#define all(a) a.begin(),a.end()
//Constants
#define PI 3.141592653593
#define MOD 1000000007LL
#define EPS 0.000000001
//loops
#define REP(i,n) for(int i=0;i<(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define DFOR(i,a,b) for(int i=(a);i>=(b);--i)
//vectors
#define vi vector<int>
#define vll vector<ll>
#define vii vector<pair<int,int> >
#define pb push_back
//pairs
#define pi pair<int,int>
#define pll pair<ll,ll>
#define mp make_pair
#define F first
#define S second
//fast I/O
#ifndef _WIN32
#define getchar getchar_unlocked
#define putchar putchar_unlocked
#endif
#define gc getchar
#define pc putchar
#define scan getFoo
//If using cin and cout
#define IOS ios::sync_with_stdio(false)
#define TIE cin.tie(NULL);cout.tie(NULL)
//queue
#define di deque<int>
#define qi queue<int>
#define PQ priority_queue
//general
#define E empty()
//Declare all variables and methods needed between this comment and the next one(OCD lol)
ll gcd(ll a,ll b){
if(!b)
return a;
return gcd(b,a%b);
}
//Main function
int main(){
IOS;
TIE;
string str0,str1;
cin>>str0>>str1;
int cnt=0;
str0+="$";
int len=str1.length();
REP(i,len)
if(str1[i]==str0[cnt])
++cnt;
cout<<cnt+1<<endl;
return 0;
}
Click to see test details