提交时间:2024-01-23 15:08:19

运行 ID: 124595

#include<bits/stdc++.h> using namespace std; string a[10010]; signed main(){ int cnt = 0; while(cin >> a[++cnt]); sort(a+1,a+cnt+1); int t = a[1].length(); for(int i =2 ;i <= cnt;i++){ int j = 0; while(a[i][j] == a[i-1][j] && j < a[i-1].length()) j++; t+=a[i].length()-j; } cout << t+1<<endl; return 0; }