QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#678750 | #7262. String Modification | Imran_86 | WA | 0ms | 3728kb | C++20 | 993b | 2024-10-26 16:01:42 | 2024-10-26 16:01:42 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define ll long long int
#define all(v) (v).begin(),(v).end()
#define set_bits __builtin_popcountll
void solve()
{
string s,s1;
cin>>s>>s1;
if(s[0]!=s1[0])
{
cout<<"No"<<endl;
}
else
{
int j=0;
int c=0;
for (int i = 0; i < s.size(); ++i)
{
if(s[i]==s1[j])
{
j++;
c=0;
}
else
{
if(s1[j]==s[i-1]&&c==0)
{
cout<<"No"<<endl;
return;
}
else
{
c=1;
i--;
j++;
}
}
}
cout<<"Yes"<<endl;
}
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
/*int t;
cin>>t;
while(t--)*/
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3620kb
input:
snuke snukent
output:
Yes
result:
ok answer is YES
Test #2:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
snuke ssnuke
output:
No
result:
ok answer is NO
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3728kb
input:
babaaaabaabbabbbbaaabaabbbbbbaaaababababbbbaabbaaaababababaaabaababbaaabbbbaabbbbbbbabaaabbaaaaabbbbabbabaabbbaaabaababbbabbaababbaaaababbaabbbaabbbababbbb baabbaababaaabababababbabbaabbbabbbbaaaabbabaababbababbaabbbaababaabbbabbbaabaabbababaababbaaabbaaababbaaaabbababababbbaaabbababababbbaaabbbabab...
output:
No
result:
wrong answer expected YES, found NO