QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#678731 | #7262. String Modification | Imran_86 | WA | 0ms | 3524kb | C++20 | 993b | 2024-10-26 15:54:57 | 2024-10-26 15:55:00 |
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;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3516kb
input:
snuke snukent
output:
Yes
result:
ok answer is YES
Test #2:
score: 0
Accepted
time: 0ms
memory: 3476kb
input:
snuke ssnuke
output:
No
result:
ok answer is NO
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3524kb
input:
babaaaabaabbabbbbaaabaabbbbbbaaaababababbbbaabbaaaababababaaabaababbaaabbbbaabbbbbbbabaaabbaaaaabbbbabbabaabbbaaabaababbbabbaababbaaaababbaabbbaabbbababbbb baabbaababaaabababababbabbaabbbabbbbaaaabbabaababbababbaabbbaababaabbbabbbaabaabbababaababbaaabbaaababbaaaabbababababbbaaabbababababbbaaabbbabab...
output:
No
result:
wrong answer expected YES, found NO