提交时间:2024-01-23 15:10:24
运行 ID: 124602
#include<bits/stdc++.h> using namespace std; string s[100005]; int main() { int len=0; while(cin>>s[++len]) continue; sort(s+1,s+len+1); int t=s[1].length(); for(int i=2;i<=len;i++) { int j=0; while(s[i][j] == s[i-1][j] && j < s[i-1].length())j++; t += s[i].length() - j; } cout<<++t<<endl; return 0; }