Submission #116840

# Submission time Handle Problem Language Result Execution time Memory
116840 2019-06-14T02:32:11 Z gaoxam123 Lozinke (COCI17_lozinke) C++14
100 / 100
310 ms 15272 KB
#include<bits/stdc++.h>
using namespace std;
int n;
string l[20005];
unordered_set<string> s;
unordered_map<string, int> m;
int main(){
  	cin>>n;
  	for(int i=0;i<n;i++){
  	  	cin>>l[i];
    	s.clear();
    	for(int j=0;j<l[i].size();j++){
      		string a;
      		for(int k=j;k<l[i].size();k++){
        		a.push_back(l[i][k]);
        		s.insert(a);
      		}
    	}
    for(auto &x:s)
      	m[x]++;
  	}
  	int ans=0;
  	for(auto &x:l)
    	ans+=m[x];
  	cout<<ans-n;
}

Compilation message

lozinke.cpp: In function 'int main()':
lozinke.cpp:12:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
      for(int j=0;j<l[i].size();j++){
                  ~^~~~~~~~~~~~
lozinke.cpp:14:22: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for(int k=j;k<l[i].size();k++){
                     ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 3 ms 1024 KB Output is correct
2 Correct 3 ms 1024 KB Output is correct
3 Correct 3 ms 1024 KB Output is correct
4 Correct 3 ms 1024 KB Output is correct
5 Correct 4 ms 1280 KB Output is correct
6 Correct 10 ms 1280 KB Output is correct
7 Correct 13 ms 2048 KB Output is correct
8 Correct 20 ms 2688 KB Output is correct
9 Correct 43 ms 2552 KB Output is correct
10 Correct 113 ms 7300 KB Output is correct
11 Correct 74 ms 4136 KB Output is correct
12 Correct 275 ms 15272 KB Output is correct
13 Correct 127 ms 2568 KB Output is correct
14 Correct 193 ms 13912 KB Output is correct
15 Correct 310 ms 15024 KB Output is correct
16 Correct 106 ms 1144 KB Output is correct
17 Correct 57 ms 1016 KB Output is correct
18 Correct 43 ms 1024 KB Output is correct
19 Correct 143 ms 7944 KB Output is correct
20 Correct 58 ms 1024 KB Output is correct