Submission #152098

#TimeUsernameProblemLanguageResultExecution timeMemory
152098Runtime_error_Lozinke (COCI17_lozinke)C++14
100 / 100
533 ms16644 KiB
#include <bits/stdc++.h> using namespace std; const int inf = 2e4+9; map<string,int> mp; vector<string> v; int main(){ int n,ans = 0; cin>>n; for(int i=1;i<=n;i++){ string tmp; set<string> s; cin>>tmp; for(int j=0;j<tmp.size();j++){ string cur = ""; for(int z=j;z<tmp.size();z++) cur += tmp[z],s.insert(cur); } v.push_back(tmp); for(auto o:s) mp[o] ++; } for(auto o:v) ans += mp[o]-1; cout<<ans<<endl; }

Compilation message (stderr)

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