Submission #3260159


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;

#define For(i, a, b) for(int i = (a); i < (b); i++)
#define Rep(i, n) For(i, 0, (n))
#define Rrep(i, n) for(int i = (n - 1); i >= 0; i--)
#define Itr(i, c) for(typeof(c.begin()) i = c.begin(); i != c.end(); i++)
#define pb push_back

const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const int MAX = 510000;
const int INF = 999999999;
const int MOD = 1000000007;

int main(){
	string s, t; cin >> s >> t;
	int l = s.size(), a[26], b[26];
	Rep(i, 26){
		a[i] = 0; b[i] = 0;
	}
	Rep(i, l){
		a[s[i] - 'a'] += 1;
		b[t[i] - 'a'] += 1;
	}
	Rep(i, l){
		if(a[s[i] - 'a'] != b[t[i] - 'a']){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Submission Info

Submission Time
Task C - String Transformation
User niimi
Language C++14 (GCC 5.4.1)
Score 300
Code Size 805 Byte
Status
Exec Time 14 ms
Memory 776 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01, sample_02, sample_03
All 300 / 300 0_min0, 0_min1, 1_small0, 1_small1, 1_small2, 2_medium0, 2_medium1, 2_medium2, 2_medium3, 2_medium4, 3_max0, 3_max1, 3_max2, 3_max3, 3_max4, 3_max5, 3_max6, 3_max7, 3_max8, 3_max9, 5_hand0, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
0_min0 1 ms 256 KB
0_min1 1 ms 256 KB
1_small0 1 ms 256 KB
1_small1 1 ms 256 KB
1_small2 1 ms 256 KB
2_medium0 11 ms 772 KB
2_medium1 10 ms 772 KB
2_medium2 4 ms 384 KB
2_medium3 13 ms 776 KB
2_medium4 11 ms 772 KB
3_max0 14 ms 776 KB
3_max1 14 ms 776 KB
3_max2 14 ms 776 KB
3_max3 14 ms 776 KB
3_max4 14 ms 776 KB
3_max5 14 ms 776 KB
3_max6 14 ms 776 KB
3_max7 14 ms 776 KB
3_max8 14 ms 776 KB
3_max9 14 ms 776 KB
5_hand0 1 ms 256 KB
sample_01 1 ms 256 KB
sample_02 1 ms 256 KB
sample_03 1 ms 256 KB