Submission #1010698

#TimeUsernameProblemLanguageResultExecution timeMemory
1010698tarpentRound words (IZhO13_rowords)C++14
12 / 100
1 ms348 KiB
#include<bits/stdc++.h>
using namespace std;


string a,b;
int m,pr,od;
vector<char> ch;
int aa[26] = {0};
int bb[26] = {0};
int main(){
	cin>>a>>b;
	
	
	for(int i = 0; i<a.size(); i++){
		aa[a[i]-'a']++;
	}
	for(int i = 0; i<b.size(); i++){
		bb[a[i]-'a']++;
	}
	for(int i = 0;i<26; i++) od+=min(aa[i],bb[i]);
	cout<<od;
	
	
	
}

Compilation message (stderr)

rowords.cpp: In function 'int main()':
rowords.cpp:14:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |  for(int i = 0; i<a.size(); i++){
      |                 ~^~~~~~~~~
rowords.cpp:17:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   17 |  for(int i = 0; i<b.size(); i++){
      |                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...