Submission #44579

#TimeUsernameProblemLanguageResultExecution timeMemory
44579heonLozinke (COCI17_lozinke)C++11
100 / 100
594 ms17804 KiB
#include<iostream> #include<map> #include<set> using namespace std; #define MAXN 20005 int n; string arr[MAXN]; map <string,int> mp; set <string> v; int sol = 0; int main(){ cin >> n; for(int i = 0; i < n; i++){ cin >> arr[i]; v.clear(); for(int j = 0; j < arr[i].size(); j++){ string curr; for(int l = j; l < arr[i].size(); l++){ curr.push_back(arr[i][l]); v.insert(curr); } } for(auto& j : v){ mp[j]++; } } for(auto& x : arr){ sol += mp[x]; } cout << sol - n; }

Compilation message (stderr)

lozinke.cpp: In function 'int main()':
lozinke.cpp:20:20: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
   for(int j = 0; j < arr[i].size(); j++){
                  ~~^~~~~~~~~~~~~~~
lozinke.cpp:22:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for(int l = j; l < arr[i].size(); l++){
                   ~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...