Submission #80252

#TimeUsernameProblemLanguageResultExecution timeMemory
80252MatheusLealVLozinke (COCI17_lozinke)C++17
90 / 100
1076 ms17508 KiB
#include <bits/stdc++.h> #define N 20050 using namespace std; typedef long long ll; int n; ll ans; map<string, int> mapa; string v[N]; int main() { ios::sync_with_stdio(false); cin.tie(0); cin>>n; for(int t = 1; t <= n; t++) { string s; set<string> ss; cin>>s; v[t] = s; ans += (ll)mapa[s]; for(int i = 0; i < s.size(); i++) { string aux; for(int j = i; j < s.size(); j++) { aux.push_back(s[j]); ss.insert(aux); } } for(auto x: ss) mapa[x] ++; } mapa.clear(); for(int t = n; t >= 1; t--) { string s = v[t]; set<string> ss; ans += (ll)mapa[s]; for(int i = 0; i < s.size(); i++) { string aux; for(int j = i; j < s.size(); j++) { aux.push_back(s[j]); ss.insert(aux); } } for(auto x: ss) mapa[x] ++; } cout<<ans<<"\n"; }

Compilation message (stderr)

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