Submission #661327

# Submission time Handle Problem Language Result Execution time Memory
661327 2022-11-25T13:59:12 Z Trisanu_Das Lozinke (COCI17_lozinke) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;

int main(){
  	int n; cin >> n;
    string a[n];
    unordered_set<string> s;
    unordered_map<string, int> m;
  	for(int i = 0;i < n; i++){
  	  	cin >> a[i];
    	s.clear();
    	for(int j = 0;j < a[i].size(); j++){
      		string ss;
      		for(int k = j; k < a[i].size(); k++){
        		ss += a[i][k]; s.insert(ss);
      		}
    	}
        for(auto &x : s) m[x]++;
  	}
  	int ans = 0;
  	for(auto &x:l) ans += m[x];
  	cout << ans - n << '\n';
}

Compilation message

lozinke.cpp: In function 'int main()':
lozinke.cpp:12:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |      for(int j = 0;j < a[i].size(); j++){
      |                    ~~^~~~~~~~~~~~~
lozinke.cpp:14:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   14 |         for(int k = j; k < a[i].size(); k++){
      |                        ~~^~~~~~~~~~~~~
lozinke.cpp:21:16: error: 'l' was not declared in this scope
   21 |    for(auto &x:l) ans += m[x];
      |                ^