UVa 902 Password Search
解題:利用map存各個Substring的出現率,找最大的 1 #include <stdio.h> 2 #include <iostream> 3 #include <algorithm> 4 #include <string> 5 #include <vector> 6 #include <map> 7 using namespace std ; 8 int main () 9 { 10 int n ; 11 while ( cin >> n ) 12 { 13 string str , sub ; 14 map < string , int > m ; 15 cin >> str ; 16 int len = str . length (); 17 for ( int i = 0 ; i <= len - n ; i ++) 18 { ...