Submission #140685

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1406852019-08-04 13:38:27AlexPascu007Lozinke (COCI17_lozinke)C++98
100 / 100
262 ms2552 KiB
#include <iostream>
#include <map>
#include <string>
#include <set>
#include <algorithm>
using namespace std;
map<string, int> m;
string s[20010],sc;
set<string> st;
int cmp(string a,string b) {
if (a.size()!=b.size())
return a.size()<b.size();
else
return a<b;
}
int n,i,j,k,sol;
int main() {
cin>>n;
for (i=1;i<=n;i++)
cin>>s[i];
sort(s+1,s+n+1,cmp);
for (i=1;i<=n;i++) {
st.clear();
for (j=0;j<s[i].size();j++) {
sc.erase(sc.begin(),sc.end());
for (k=j;k<s[i].size();k++) {
sc.push_back(s[i][k]);
st.insert(sc);
}
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

lozinke.cpp: In function 'int main()':
lozinke.cpp:24:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (j=0;j<s[i].size();j++) {
                  ~^~~~~~~~~~~~
lozinke.cpp:26:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             for (k=j;k<s[i].size();k++) {
                      ~^~~~~~~~~~~~
lozinke.cpp:31:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
         for (set<string>:: iterator it=st.begin();it!=st.end();it++)
         ^~~
lozinke.cpp:34:13: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
             if (m.find(s[i])==m.end())
             ^~
#Verdict Execution timeMemoryGrader output
Fetching results...