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

WA。。。。编译器都没问题。。。怎么提交就出错呢? (附代码)

Posted by huaigu at 2010-08-03 19:05:44 on Problem 2159
#include<iostream>
#include<string>
using namespace std;
int main(){
    string str="";
    string cmp="";
    int count1[26]={0},count2[26]={0};
    int i=0;
    int count[26]={0}; 
    cin>>cmp>>str;
    int l=cmp.size();
    for(i=0;i<l;i++){  
        count1[str[i]-'A']++;
        count2[cmp[i]-'A']++;  
    } 
    for(i=0;i<26;i++){
        count[count1[i]]++;
        count[count2[i]]--;
    } 
    for(i=0;i<l;i++){
        if(count[i]!=0){
            cout<<"NO"<<endl;
            return 0;
        }
    }
    cout<<"YES"<<endl;
    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