Submission #639055

# Submission time Handle Problem Language Result Execution time Memory
639055 2022-09-08T11:51:26 Z inksamurai Lozinke (COCI17_lozinke) C++17
40 / 100
1000 ms 1108 KB
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rng(i,c,n) for(int i=c;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)a.size()
#define vec(...) vector<__VA_ARGS__>
#define _3RhsN1z ios::sync_with_stdio(0),cin.tie(0)
typedef long long ll;
using pii=pair<int,int>;
using vi=vector<int>;
void print(){cout<<'\n';}
template<class h,class...t>
void print(const h&v,const t&...u){cout<<v<<' ',print(u...);}
// e

signed main(){
_3RhsN1z;
	int n;
	cin>>n;
	vec(string) a(n);
	rep(i,n){
		cin>>a[i];
	}
	int cnt=0;
	rep(i,n){
		rep(j,n){
			if(i!=j){
				if(sz(a[j])>=sz(a[i])){
					rep(k,sz(a[j])-sz(a[i])+1){
						if(a[j].substr(k,sz(a[i]))==a[i]){
							cnt+=1;
							break;
						}
					}
				}		
			}
		}
	}
	print(cnt);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 320 KB Output is correct
4 Correct 6 ms 324 KB Output is correct
5 Correct 36 ms 340 KB Output is correct
6 Correct 81 ms 360 KB Output is correct
7 Correct 124 ms 340 KB Output is correct
8 Correct 113 ms 388 KB Output is correct
9 Execution timed out 1084 ms 596 KB Time limit exceeded
10 Execution timed out 1078 ms 708 KB Time limit exceeded
11 Execution timed out 1077 ms 852 KB Time limit exceeded
12 Execution timed out 1079 ms 852 KB Time limit exceeded
13 Execution timed out 1079 ms 1108 KB Time limit exceeded
14 Execution timed out 1069 ms 1068 KB Time limit exceeded
15 Execution timed out 1088 ms 1108 KB Time limit exceeded
16 Execution timed out 1089 ms 1108 KB Time limit exceeded
17 Execution timed out 1078 ms 1108 KB Time limit exceeded
18 Execution timed out 1089 ms 1108 KB Time limit exceeded
19 Execution timed out 1090 ms 980 KB Time limit exceeded
20 Execution timed out 1054 ms 1096 KB Time limit exceeded