# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
472760 | 2021-09-14T09:44:16 Z | MamdouhN | Lozinke (COCI17_lozinke) | C++14 | 1000 ms | 6556 KB |
#include<bits/stdc++.h> using namespace std; #define int long long #define endl "\n" int n,ans; string password[200002]; void check(string a,string b) { int sizeofb = b.size(); for(int i = 0;i<a.size();i++) { if(i+b.size()>a.size())break; if(a[i]==b[0]) { int x=i; int j=0; int sz=0; while(a[x]==b[j]&&x<a.size()&&j<sizeofb) { sz++; j++; x++; } if(sz==sizeofb) { ans++; return; } } } } main() { cin>>n; for(int i=0;i<n;i++)cin>>password[i]; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(j==i)continue; if(password[j].size()>password[i].size())continue; //cout<<password[i]<<" "<<password[j]<<endl; check(password[i],password[j]); } } cout<<ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 6476 KB | Output is correct |
2 | Correct | 4 ms | 6476 KB | Output is correct |
3 | Correct | 4 ms | 6552 KB | Output is correct |
4 | Correct | 10 ms | 6556 KB | Output is correct |
5 | Correct | 35 ms | 6476 KB | Output is correct |
6 | Correct | 74 ms | 6476 KB | Output is correct |
7 | Correct | 116 ms | 6528 KB | Output is correct |
8 | Correct | 101 ms | 6528 KB | Output is correct |
9 | Execution timed out | 1076 ms | 6476 KB | Time limit exceeded |
10 | Execution timed out | 1081 ms | 6476 KB | Time limit exceeded |
11 | Execution timed out | 1090 ms | 6476 KB | Time limit exceeded |
12 | Execution timed out | 1083 ms | 6476 KB | Time limit exceeded |
13 | Execution timed out | 1083 ms | 6476 KB | Time limit exceeded |
14 | Execution timed out | 1078 ms | 6476 KB | Time limit exceeded |
15 | Execution timed out | 1079 ms | 6476 KB | Time limit exceeded |
16 | Execution timed out | 1079 ms | 6476 KB | Time limit exceeded |
17 | Execution timed out | 1081 ms | 6476 KB | Time limit exceeded |
18 | Execution timed out | 1081 ms | 6476 KB | Time limit exceeded |
19 | Execution timed out | 1085 ms | 6476 KB | Time limit exceeded |
20 | Execution timed out | 1085 ms | 6476 KB | Time limit exceeded |