Submission #48539694
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll MOD=998244353;
// head
const int N=3e5+5;
int cnt[N],sum[N];
signed main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
string s;cin>>s;
string t;cin>>t;
int tmp;
if(s[1]-s[0]==1||s[1]-s[0]==4||s[1]-s[0]==-4||s[1]-s[0]==-1) tmp=1;
else tmp=2;
if(t[1]-t[0]==1||t[1]-t[0]==4||t[1]-t[0]==-4||t[1]-t[0]==-1) {
if(tmp==1) cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
else {
if(tmp==1) cout<<"No"<<endl;
else cout<<"Yes"<<endl;
}
}
Submission Info
| Submission Time | |
|---|---|
| Task | B - Pentagon |
| User | gangbengr |
| Language | C++ 20 (gcc 12.2) |
| Score | 200 |
| Code Size | 783 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3524 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3404 KiB |
| 00_sample_02.txt | AC | 1 ms | 3512 KiB |
| 00_sample_03.txt | AC | 1 ms | 3512 KiB |
| 01_test_01.txt | AC | 1 ms | 3472 KiB |
| 01_test_02.txt | AC | 1 ms | 3320 KiB |
| 01_test_03.txt | AC | 1 ms | 3524 KiB |
| 01_test_04.txt | AC | 1 ms | 3464 KiB |
| 01_test_05.txt | AC | 1 ms | 3412 KiB |
| 01_test_06.txt | AC | 1 ms | 3460 KiB |
| 01_test_07.txt | AC | 1 ms | 3416 KiB |
| 01_test_08.txt | AC | 1 ms | 3408 KiB |
| 01_test_09.txt | AC | 1 ms | 3428 KiB |
| 01_test_10.txt | AC | 1 ms | 3436 KiB |
| 01_test_11.txt | AC | 1 ms | 3472 KiB |
| 01_test_12.txt | AC | 1 ms | 3392 KiB |
| 01_test_13.txt | AC | 1 ms | 3508 KiB |
| 01_test_14.txt | AC | 1 ms | 3452 KiB |
| 01_test_15.txt | AC | 1 ms | 3512 KiB |