Submission #116823

#TimeUsernameProblemLanguageResultExecution timeMemory
116823ClementimeLozinke (COCI17_lozinke)C++17
40 / 100
65 ms648 KiB
#include <bits/stdc++.h> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <queue> using namespace std; typedef long long ll; #define FOR(i, l, r) for(ll i = l; i <= r; i++) ll num = 0; int main(){ string a[2005]; ll n; cin >> n; FOR(i, 1, n){ cin >> a[i]; } FOR(i, 1, n){ FOR(j, 1, i - 1){ size_t found = a[i].find(a[j]); if(found != string::npos) num++; size_t found1 = a[j].find(a[i]); if(found1 != string::npos) num++; } } cout << num; }
#Verdict Execution timeMemoryGrader output
Fetching results...