/*
Old password for Chinese questions
You can see if you can change the location of the first character to exactly match the 26 letters of the second character.
Solution: count the number of characters in two strings. If the number of characters in each string is the same, yes is output; otherwise, no is output.
Difficulties: it is a little difficult to count the number of times each character appears.
Key Point: Sorting
Problem solving person: lingnichong
Solution time:
Experience in solving problems: a good question
*/
1339-maximum ent ciphertime limit: 3.000 seconds |
# Include <stdio. h> # include <string. h ># include <algorithm> using namespace STD; char cot1 [300], cot2 [300]; int A [30], B [30]; int main () {int I, L, len1, len2; while (~ Scanf ("% S % s", cot1, cot2) {memset (A, 0, sizeof (a); memset (B, 0, sizeof (B )); len1 = strlen (cot1); len2 = strlen (cot2); If (len1> len2) L = len1; else l = len2; for (I = 0; I <L; I ++) {++ A [cot1 [I]-'a']; ++ B [cot2 [I]-'a'];} Sort (, A + 26); sort (B, B + 26); for (I = 0; I <26; I ++) if (a [I]! = B [I]) break; printf (I = 26? "Yes \ n": "No \ n");} return 0 ;}
UVA 1339 sort ent cipher [sort]