Submission #26279374
Source Code Expand
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<int(n); i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
int main(void){
string S, T;
cin >> S >> T;
rep(i, S.length()-1){
if(i==0 && S==T){
cout << "Yes" << endl;
return 0;
}
char tmp=S[i];
S[i]=S[i+1];
S[i+1]=tmp;
if(S==T){
cout << "Yes" << endl;
return 0;
}
S[i+1]=S[i];
S[i]=tmp;
}
cout << "No" << endl;
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - typo |
| User | m_are |
| Language | C++ (GCC 9.2.1) |
| Score | 200 |
| Code Size | 649 Byte |
| Status | AC |
| Exec Time | 5 ms |
| Memory | 3636 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 | 5 ms | 3556 KiB |
| 001.txt | AC | 2 ms | 3580 KiB |
| 002.txt | AC | 2 ms | 3560 KiB |
| 003.txt | AC | 2 ms | 3484 KiB |
| 004.txt | AC | 2 ms | 3600 KiB |
| 005.txt | AC | 2 ms | 3636 KiB |
| 006.txt | AC | 2 ms | 3636 KiB |
| 007.txt | AC | 2 ms | 3628 KiB |
| 008.txt | AC | 2 ms | 3424 KiB |
| 009.txt | AC | 2 ms | 3600 KiB |
| 010.txt | AC | 2 ms | 3604 KiB |
| 011.txt | AC | 3 ms | 3588 KiB |
| example0.txt | AC | 3 ms | 3412 KiB |
| example1.txt | AC | 2 ms | 3492 KiB |
| example2.txt | AC | 3 ms | 3440 KiB |