# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
959183 |
2024-04-07T15:12:55 Z |
lalig777 |
Savez (COCI15_savez) |
C++14 |
|
1000 ms |
14564 KB |
#include <iostream>
#include <vector>
using namespace std;
int main(){
int n;
cin>>n;
vector<string>v(n+1);
v[0]="";
vector<int>dp(n+1, 0);
int ans=0;
for (int i=1; i<=n; i++){
cin>>v[i];
int siz2=v[i].size();
for (int j=0; j<i; j++){
string s=v[j];
int siz=s.size();
bool bien=true;
for (int k=0; k<siz; k++){
if (s[k]!=v[i][k] or s[k]!=v[i][siz2-siz+k]){
bien=false;
break;
}
}if (bien==true) dp[i]=max(dp[i], dp[j]+1);
}ans=max(ans, dp[i]);
}cout<<ans<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
856 KB |
Output is correct |
3 |
Correct |
4 ms |
600 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
142 ms |
3168 KB |
Output is correct |
2 |
Correct |
179 ms |
3268 KB |
Output is correct |
3 |
Correct |
145 ms |
3340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
600 KB |
Output is correct |
2 |
Correct |
120 ms |
2640 KB |
Output is correct |
3 |
Correct |
129 ms |
2640 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
1116 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1082 ms |
2068 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1031 ms |
2536 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1042 ms |
3280 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1049 ms |
9000 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1065 ms |
14564 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |