Submission #569202

#TimeUsernameProblemLanguageResultExecution timeMemory
569202Garguy22Lozinke (COCI17_lozinke)C++17
40 / 100
1095 ms6740 KiB
#include <iostream>
using namespace std;

const int N = 2e5 + 7;

string str[N];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);

	int n;
	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> str[i];
	int ans = 0;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			if(i != j){
				int x = str[j].find(str[i]);
				if(x != -1)
					ans++;
			}
		}
	}
	cout << ans << endl;

	return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...