Please sign in first.
Submission #26289649
Source Code Expand
#include <bits/stdc++.h>
#define ll long long
#define ft first
#define sec second
#define pb push_back
#define pf push_front
#define pr pair<ll,ll>
#define bged(a) a.begin(),a.end()
#define ISCC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
//#pragma optimize("Ofast","unroll-loop")
using namespace std;
const int MOD = 1e9+7;
int t ,n ,m ,a[100005] ,l ,ok ,cnt;
string s1 ,s2;
int main()
{
cin >> s1 >> s2;
l = s1.size();
if(s1[0] != s2[0]) cnt=1;
for(int i=1 ;i<l ;i++)
{
if(s1[i] != s2[i]) cnt++;
if(s1[i] == s2[i-1] && s1[i-1]==s2[i]) cnt-=2;
}
if(cnt > 0){cout << "No"; }
else cout << "Yes";
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - typo |
| User | ck1080012 |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 664 Byte |
| Status | AC |
| Exec Time | 7 ms |
| Memory | 3644 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt, example2.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, example0.txt, example1.txt, example2.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 7 ms | 3512 KiB |
| 001.txt | AC | 2 ms | 3604 KiB |
| 002.txt | AC | 2 ms | 3528 KiB |
| 003.txt | AC | 2 ms | 3644 KiB |
| 004.txt | AC | 2 ms | 3632 KiB |
| 005.txt | AC | 3 ms | 3604 KiB |
| 006.txt | AC | 2 ms | 3604 KiB |
| 007.txt | AC | 2 ms | 3532 KiB |
| 008.txt | AC | 2 ms | 3408 KiB |
| 009.txt | AC | 3 ms | 3576 KiB |
| 010.txt | AC | 2 ms | 3468 KiB |
| 011.txt | AC | 2 ms | 3600 KiB |
| example0.txt | AC | 2 ms | 3576 KiB |
| example1.txt | AC | 3 ms | 3524 KiB |
| example2.txt | AC | 2 ms | 3520 KiB |