# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
170363 | mdn2002 | Lozinke (COCI17_lozinke) | C++14 | 575 ms | 16548 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
const long long mod=998244353;
int n,ans;
map<string,int>mp;
map<string,int>m;
vector<string>v;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
//freopen("lemonade.in","r",stdin);
//freopen("lemonade.out","w",stdout);
cin>>n;
for(int i=0;i<n;i++)
{
string s;
cin>>s;
v.push_back(s);
mp[s]++;
}
for(int i=0;i<n;i++)
{
for(int j=0;j<v[i].size();j++)
{
string s;
for(int z=j;z<v[i].size();z++)
{
s.push_back(v[i][z]);
if(m[s]==0)
{
ans+=mp[s];
m[s]++;
}
}
}
m.clear();
}
cout<<ans-n;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |