Submission #1010688

#TimeUsernameProblemLanguageResultExecution timeMemory
1010688lrancic원형 문자열 (IZhO13_rowords)C++17
28 / 100
1 ms604 KiB
#include <iostream>	
#include <string>

int main() {
	int a[26] = {0}, b[26] = {0};
	std::string str1, str2; std::cin >> str1 >> str2;
	for (char x : str1) a[x-'a']++; for (char x : str2) b[x-'a']++;

	int ans = 0;
	for (int i = 0; i < 26; i++) ans += std::min(a[i], b[i]);

	std::cout << ans << '\n';
}

Compilation message (stderr)

rowords.cpp: In function 'int main()':
rowords.cpp:7:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    7 |  for (char x : str1) a[x-'a']++; for (char x : str2) b[x-'a']++;
      |  ^~~
rowords.cpp:7:34: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    7 |  for (char x : str1) a[x-'a']++; for (char x : str2) b[x-'a']++;
      |                                  ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...