Submission #3255258


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 inf = 999999999;
const int mod = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int c1[26], c2[26];

int main(){
	string s, t; cin >> s >> t;
	int l = s.size();
	Rep(i, l){
		int k = s[i] - 'a';
		c1[k] += 1;
		k = t[i] - 'a';
		c2[k] += 1;
	}
	sort(c1, c1 + 26);
	sort(c2, c2 + 26);
	bool flag = true;
	Rep(i, l){
		if(c1[i] == c2[i]){
			continue;
		}else{
			flag = false;
		}
	}
	if(flag){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

Submission Info

Submission Time
Task C - String Transformation
User niimi
Language C++14 (GCC 5.4.1)
Score 0
Code Size 873 Byte
Status

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01, sample_02, sample_03
All 0 / 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
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 1 ms 256 KB
sample_01 1 ms 256 KB
sample_02 1 ms 256 KB
sample_03 1 ms 256 KB