Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

这……这是什么题啊……啊啊啊啊……(附代码)

Posted by 896295334 at 2017-10-30 16:54:16 on Problem 2159
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
char a[200],b[200];
int c[30],d[30]; 
int main(){
	while(~scanf("%s\n%s",a,b)){
		int l=strlen(a);
		memset(c,0,sizeof(c));
		memset(d,0,sizeof(d));
		for(int i=0;i<l;++i){
			c[a[i]-'A']++;
			d[b[i]-'A']++;
		}
		sort(c,c+26);
		sort(d,d+26);
		bool yes=1;
		for(int i=0;i<26;++i){
			if(c[i]!=d[i]){
				yes=0; break;
			}
		}
		if(yes==1) puts("YES");
		else puts("NO");
	}	
	return 0;
} 

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator