Problem:
看板 (Signboard)
問題
JOI 君はお店の看板を作ることにした．
文字が等間隔に書かれた古い看板が N 枚ある．JOI 君は古い看板からいくつかの文字を消すことで看板を作る．残った文字列がお店の名前になっていて，しかも残った文字が等間隔に並んでいるようにしたい．看板は 1 枚の古い看板から作らなければならず，古い看板を切ったりつなげたりしてはならない．
お店の名前と N 枚の古い看板の情報が与えられた時，JOI 君が作ることができる看板の枚数を求めるプログラムを作成せよ．ただし， 1 枚の古い看板から作ることができる看板が複数考えられる場合も，作ることができる看板は 1 枚であると考える．
入力
入力は 2 + N 行からなる．
1 行目には，整数 N
(1 ≦ N ≦ 100)
が書かれており，古い看板の枚数を表す．
2 行目には，3 文字以上 25 文字以下のアルファベット小文字からなる文字列が書かれており，お店の名前を表す．
続く N 行のうちの i 行目
(1 ≦ i ≦ N)
には 1 文字以上 100 文字以下のアルファベット小文字からなる文字列が書かれており，i 枚目の古い看板に書かれている文字列を表す．
出力
JOI 君が作ることができる看板の枚数を表す整数を 1 行で出力せよ．
入出力例
入力例
4
bar
abracadabra
bear
bar
baraxbara
出力例
3
お店の名前は bar である．
1 枚目の古い看板には文字列 abracadabra が書かれている．
この古い看板から 2 文字目，6 文字目，10 文字目以外を消すことで看板を作ることができる．
2 枚目は，2 文字目を消すと bar という文字列を作ることができるが，これは残った文字が等間隔に並んでいない．
3 枚目は，文字を何も消さなくても看板になっている．
4 枚目の古い看板から看板を作る方法は 2 通りある．
1 つの方法は，1 文字目，2 文字目，3 文字目以外を消すことである．
もう 1 つの方法は，6 文字目，7 文字目，8 文字目以外を消すことである．
よって，JOI 君は 1 枚目，3 枚目，4 枚目の古い看板から看板を作ることができるので，3 を出力する．
問題文と自動審判に使われるデータは、
情報オリンピック日本委員会
が作成し公開している問題文と採点用テストデータです。

Submitted solutions:

code_snippet: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PP;
//#define MOD 1000000007
#define MOD 998244353
#define INF 2305843009213693951
//#define INF 810114514
#define PI 3.141592653589
#define setdouble setprecision
#define REP(i,n) for(ll i=0;i<(n);++i)
#define OREP(i,n) for(ll i=1;i<=(n);++i)
#define RREP(i,n) for(ll i=(n)-1;i>=0;--i)
#define ALL(v) (v).begin(), (v).end()
#define GOODBYE do { cout << "-1" << endl; return 0; } while (false)
#define MM <<" "<<
#define Endl endl
#define debug true
#define debug2 false

int main(void){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    ll N;
    cin >> N;
    string S;
    cin >> S;

    ll Ans = 0;
    REP(i,N){
        string T;
        cin >> T;

        bool can = false;
        for(int i=0;i<(int)T.size();i++){
            for(int j=1;j<T.size();j++){
                bool ok = true;
                REP(k,S.size()){
                    if(i+j*k >= (int)T.size() || S[k]!=T[i+j*k]){
                        ok = false;
                    }
                }

                if(ok)can=true;
            }
        }

        if(can)Ans++;
    }
    
    cout << Ans << endl;

    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3356
final_rank: 8

code_snippet: #include <bits/stdc++.h>

using namespace std;
const int inf = 1e9 + 7;

int main(void) {
    int N;
    string S;
    cin >> N >> S;
    string target[N];
    for(int i = 0; i < N; i++) cin >> target[i];

    int ans = 0;

    for(int i = 0; i < N; i++){
        bool ok = false;
        int t_size = target[i].size();
        for(int start = 0; start < t_size; start++){
            for(int kankaku = 1; kankaku < t_size; kankaku++){
                string s;
                for(int j = 0; start + j * kankaku < t_size; j++){
                    s += target[i][start + j * kankaku];
                    if(s == S){
                        ok = true;
                        break;
                    }
                }
                if(ok) break;
            }
            if(ok) break;
        }
        if(ok) ans++;
    }

    cout << ans << "\n";
    return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3188
final_rank: 11

code_snippet: #include<bits/stdc++.h>

using Int = long long;
using namespace std;

int main(){
    int N;
    cin >> N;
    string base; cin >> base;
    vector<string>vs(N);
    for(string& s : vs)
        cin >> s;
    int ans = 0;
    for(auto s : vs){
        bool satisfy = false;
        for(int d = 1; d < s.size(); ++d){
            for(int pos = 0; pos < s.size(); ++pos){
                int di = 0;
                int id = 0;
                string tmp;
                while(pos + di * d < s.size()){
                    int spos = pos + di * d;
                    tmp.push_back(s[spos]);
                    ++di;
                }
                if(tmp.find(base) != std::string::npos)
                    satisfy = true;
            }
        }
        ans += (satisfy ? 1 : 0);
    }
    cout << ans << endl;
}
accuracy: 1
time_ms: 10
memory_kb: 3428
final_rank: 10

code_snippet: #include<iostream>

bool possible(std::string name, std::string signboard){
    for(int start=0; start<signboard.size(); ++start){
        for(int gap=1; gap<signboard.size(); ++gap){
            std::string s = "";
            for(int j=start; j<signboard.size(); j += gap){
                if(j >= signboard.size() || s.size() >= name.size()) break;
                s += signboard[j];
            }
            if(name == s) return true;
        }
    }
    return false;
}

int main(){
    int N; std::cin >> N;
    std::string name;
    std::cin >> name;

    std::string signboard;
    int ans=0;
    for(int n=0; n<N; ++n){
        std::cin >> signboard;
        if(possible(name, signboard)) ++ans;
    }
    std::cout << ans << std::endl;
    return 0;
}
accuracy: 1
time_ms: 40
memory_kb: 3216
final_rank: 13

code_snippet: #include <bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define drep(i,j,n) for(int i=0;i<(int)(n-1);i++)for(int j=i+1;j<(int)(n);j++)
#define trep(i,j,k,n) for(int i=0;i<(int)(n-2);i++)for(int j=i+1;j<(int)(n-1);j++)for(int k=j+1;k<(int)(n);k++)
#define codefor int test;scanf("%d",&test);while(test--)
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define yes(ans) if(ans)printf("yes\n");else printf("no\n")
#define Yes(ans) if(ans)printf("Yes\n");else printf("No\n")
#define YES(ans) if(ans)printf("YES\n");else printf("NO\n")
#define vector1d(type,name,...) vector<type>name(__VA_ARGS__)
#define vector2d(type,name,h,...) vector<vector<type>>name(h,vector<type>(__VA_ARGS__))
#define vector3d(type,name,h,w,...) vector<vector<vector<type>>>name(h,vector<vector<type>>(w,vector<type>(__VA_ARGS__)))
#define umap unordered_map
#define uset unordered_set
using namespace std;
using ll = long long;
const int MOD=1000000007;
const int MOD2=998244353;
const int INF=1<<30;
const ll INF2=(ll)1<<60;
//入力系
void scan(int& a){scanf("%d",&a);}
void scan(long long& a){scanf("%lld",&a);}
template<class T,class L>void scan(pair<T, L>& p){scan(p.first);scan(p.second);}
template<class T> void scan(T& a){cin>>a;}
template<class T> void scan(vector<T>& vec){for(auto&& it:vec)scan(it);}
void in(){}
template <class Head, class... Tail> void in(Head& head, Tail&... tail){scan(head);in(tail...);}
//出力系
void print(const int& a){printf("%d",a);}
void print(const long long& a){printf("%lld",a);}
void print(const double& a){printf("%.15lf",a);}
template<class T,class L>void print(const pair<T, L>& p){print(p.first);putchar(' ');print(p.second);}
template<class T> void print(const T& a){cout<<a;}
template<class T> void print(const vector<T>& vec){if(vec.empty())return;print(vec[0]);for(auto it=vec.begin();++it!= vec.end();){putchar(' ');print(*it);}}
void out(){putchar('\n');}
template<class T> void out(const T& t){print(t);putchar('\n');}
template <class Head, class... Tail> void out(const Head& head,const Tail&... tail){print(head);putchar(' ');out(tail...);}
//デバッグ系
template<class T> void dprint(const T& a){cerr<<a;}
template<class T> void dprint(const vector<T>& vec){if(vec.empty())return;cerr<<vec[0];for(auto it=vec.begin();++it!= vec.end();){cerr<<" "<<*it;}}
void debug(){cerr<<endl;}
template<class T> void debug(const T& t){dprint(t);cerr<<endl;}
template <class Head, class... Tail> void debug(const Head& head, const Tail&... tail){dprint(head);cerr<<" ";debug(tail...);}
ll intpow(ll a, ll b){ ll ans = 1; while(b){ if(b & 1) ans *= a; a *= a; b /= 2; } return ans; }
ll modpow(ll a, ll b, ll p){ ll ans = 1; while(b){ if(b & 1) (ans *= a) %= p; (a *= a) %= p; b /= 2; } return ans; }
ll updivide(ll a,ll b){if(a%b==0) return a/b;else return (a/b)+1;}
template<class T> void chmax(T &a,const T b){if(b>a)a=b;}
template<class T> void chmin(T &a,const T b){if(b<a)a=b;}

int main(){
    INT(n);
    string s,t;
    cin>>s;
    int ans=0;
    bool flag;
    rep(i,n){
        cin>>t;
        for(int j=1;j<t.size();j++){
            for(int k=0;k<t.size();k++){
                string u;
                for(int l=0;l<s.size();l++){
                    if(j*l+k<t.size())u+=t[j*l+k];
                }
                if(s==u){
                    ans++;
                    goto skip;
                }
            }
        }
        skip: ;
    }
    out(ans);
}
accuracy: 1
time_ms: 30
memory_kb: 3308
final_rank: 12

code_snippet: #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; --i)
#define FOR(i, m, n) for (int i = m; i < n; ++i)
#define FORR(i, m, n) for (int i = m; i >= n; --i)
#define ALL(v) (v).begin(),(v).end()
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const ll INF=1LL<<60;
const int inf=(1<<30)-1;
const int mod=1e9+7;
int dx[8]={1,0,-1,0,-1,-1,1,1};
int dy[8]={0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin >> n;
    string t;cin >> t;
    vector<string> s(n);
    int m=t.size();
    int ans=0;
    REP(i,n){
        cin >> s[i];
        bool f=false;
        for(int j=1;1+(m-1)*j<=s[i].size();j++){
            for(int k=0;k+(m-1)*j<s[i].size();k++){
                string u="";
                for(int l=0;l<m;l++){
                    u+=s[i][k+j*l];
                }
                if(u==t){
                    f=true;
                }
            }
        }
        if(f) ans++;
    }
    cout << ans << endl;
}
accuracy: 1
time_ms: 20
memory_kb: 3236
final_rank: 7

code_snippet: #include <iostream>
#include <string>

void solve() {
    int q;
    std::string s;
    std::cin >> q >> s;

    int ans = 0;
    while (q--) {
        std::string t;
        std::cin >> t;
        int m = t.length();

        bool ok = false;
        for (int l = 1; l < m; ++l) {
            for (int i = 0; i < m; ++i) {
                int j = i;
                bool judge = true;

                for (char c : s) {
                    if (j >= m || t[j] != c) judge = false;
                    j += l;
                }

                if (judge) ok = true;
            }
        }

        if (ok) ++ans;
    }

    std::cout << ans << "\n";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}
accuracy: 1
time_ms: 20
memory_kb: 3216
final_rank: 6

code_snippet: #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

int main() {
  int N;
  string S;
  cin >> N >> S;
  vector<string> sb(N);
  for (int i = 0; i < N; ++i)
    cin >> sb[i];

  int ans = 0;
  for (int i = 0; i < N; ++i) {
    bool flag = false;
    for (int j = 0; j < sb[i].size() - S.size() + 1; ++j) {
      for (int k = 1; k < sb[i].size(); ++k) {
        string S2;
        for (int l = j; l < sb[i].size(); l += k)
          S2 += sb[i][l];

        if (S2.substr(0, S.size()) == S)
          flag = true;

        if (flag)
          break;
      }

      if (flag)
        break;
    }

    if (flag)
      ++ans;
  }

  cout << ans << endl;
}
accuracy: 1
time_ms: 50
memory_kb: 3188
final_rank: 15

code_snippet: #include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int test[321][321];
int main() {
	long long n, ans = 0; string s, t; cin >> n >> s;
	for (int h = 0; h < n; h++) {
		cin >> t; 
		for (int i = 0; i < t.size(); i++) {
			for (int j = 1; j <= 100; j++) {
				int sum = 0;
				for (int k = 0; k < s.size(); k++) {
					if (i + (j * k) < t.size()) {
						if (t[i + (j * k)] == s[k]) {
							sum++;
						}
					}
				}
				if (sum == s.size()) {
					ans++; i = t.size(); j = 100;
				}
			}
		}
	}
	cout << ans << endl;
	cin >> n;
}
accuracy: 1
time_ms: 10
memory_kb: 3180
final_rank: 4

code_snippet: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using VI = vector<int>;
using VL = vector<ll>;
#define FOR(i,a,n) for(int (i)=(a);(i)<(n);++(i))
#define eFOR(i,a,n) for(int (i)=(a);(i)<=(n);++(i))
#define rFOR(i,a,n) for(int (i)=(n)-1;(i)>=(a);--(i))
#define erFOR(i,a,n) for(int (i)=(n);(i)>=(a);--(i))
#define SORT(i) sort((i).begin(),(i).end())
#define rSORT(i,a) sort((i).begin(),(i).end(),(a))
#define all(i) (i).begin(),(i).end()
#define out(y,x,h,w) (y) < 0 || (h) <= (y) || (x) < 0 || (w) <= (x)
#define line cout << "------------------------\n" 
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
const long double pi = acos(-1);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; }return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; }return 0; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& input, vector<T>& v) { for (auto& elemnt : v)input >> elemnt; return input; }

int main() {
    init();

    int n; string s; cin >> n >> s;
    int k = s.length();
    int ans = 0;
    FOR(fugfuyfffsdfvgefge, 0, n) {
        string t; cin >> t;
        int m = t.length();

        bool ok = false;
        FOR(diff, 1, m)FOR(start, 0, m) {
            bool s_ok = true;
            FOR(i, 0, k) {
                s_ok &= (start + i * diff < m && s[i] == t[start + i * diff]);
            }
            ok |= s_ok;
        }
        if (ok)++ans;
    }
    cout << ans << "\n";
}
accuracy: 1
time_ms: 10
memory_kb: 3212
final_rank: 5

code_snippet: #include "bits/stdc++.h"

using namespace std;

//int N,M,K,L,R,H,W;
long long int N,M,K,L,R,H,W;

//constexpr long long int MOD=1000000007;
//constexpr  int MOD=1000000007;
constexpr int MOD=998244353;
//constexpr long long int MOD=998244353;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	cin>>N;
	string s;
	cin>>s;
	vector<string>u(N);
	for(auto &i:u)cin>>i;
	int ans=0;
	for(auto i:u){
		int add=0;
		for(int l=0;l<i.size();l++){
			for(int j=1;j<i.size();j++){
				string t;
				for(int k=l;k<i.size()&&t.size()<s.size();k+=j){
					t.push_back(i[k]);
				}
				if(s==t)add|=1;
			}
		}
		ans+=add;
		//cout<<ans<<endl;
	}
	cout<<ans<<endl;
	return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 3232
final_rank: 17

code_snippet: #include <bits/stdc++.h>

using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

signed main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int n;
  string name;
  cin >> n >> name;

  int ans = 0;
  string s;
  rep(i, n) {
    cin >> s;

    bool isOK = false;
    for (int j = 0; j < s.length(); ++j) {
      for (int k = 1; k < s.length(); ++k) {
        string u = "";
        for (int l = j; l < s.length(); l += k) {
          u += s[l];
        }
        if (u.length() < name.length()) continue;
        if (u.find(name) + 1) isOK = true;
      }
    }
    if (isOK) ++ans;
  }

  cout << ans << "\n";

  return 0;
}
accuracy: 1
time_ms: 70
memory_kb: 3176
final_rank: 19

code_snippet: #include <cstdio>
#include <cctype>
#include <utility>
#include <string>
using namespace std;

const auto gcu = getchar_unlocked;
const auto pcu = putchar_unlocked;
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;if(n<0)pcu('-'),n*=-1;
	if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10; while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	int n = in(), c = 0;
	string s, t;
	scan(s);
	while (n--) {
		scan(t);
		c += [&] {
			for (int i = 0; i <= (int) t.size() - (int) s.size(); i++)
				if (s[0] == t[i])
					for (int j = 1; i + j * (s.size() - 1) < t.size(); j++) {
						try {
							for (size_t k = 1; k < s.size() ; k++)
								if (t[i + j * k] != s[k])
									throw 0;
							return 1;
						} catch (...) {
							;
						}
					}
			return 0;
		}();
	}
	outl(c);
}
accuracy: 1
time_ms: 10
memory_kb: 2768
final_rank: 1

code_snippet: #include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-2;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
int n; string s;
int main() {
	cin >> n >> s; int ans = 0;
	rep(i, n) {
		string t; cin >> t;
		bool exi = false;
		for (int i = 0; i < t.size(); i++) {
			for (int j = 1; j < t.size(); j++) {
				string u;
				for (int k = i; k < t.size(); k += j) {
					u.push_back(t[k]);
				}
				if (u.length() < s.length())continue;
				if (u.substr(0, s.length()) == s)exi = true;
			}
		}
		if (exi)ans++;
	}
	cout << ans << endl;
	//stop
	return 0;
}
accuracy: 1
time_ms: 60
memory_kb: 3168
final_rank: 18

code_snippet: #include<iostream>
#include<string>
using namespace std;

bool judgeCanIMakeSign( string s, string a )
{
    int as = a.size(), ss = s.size();
    char* b = new char[as];

    for( int i = 0; i < ss; i++ )
    {
        int con = 1;
        b[0] = s[i];
        while(  i + con * ( as - 1 ) < ss )
        {
            int p = con;
            for( int j = 1; j < as; j++ )
            {
                b[j] = s[i+con];
                con += p;
            }
            con = p + 1;
            
            string res = "";
            for( int j = 0; j < as; j++ )
                res += b[j];

            if( a == res )
            {
                delete b;
                return true;
            }
        }
    }

    delete b;
    return false;
}

int main()
{
    int n;
    string a, s;

    cin >> n >> a;

    int cnt = 0;
    for( int i = 0; i < n; i++ )
    {
        cin >> s;
        if( judgeCanIMakeSign( s, a ) )
            cnt++;
    }

    cout << cnt << endl;

    return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3152
final_rank: 2

code_snippet: //Signboard
#include <iostream>

using namespace std;

int main() {
    int N;
    string base, str;
    bool flg;
    cin >> N;
    cin >> base;
    int cnt = 0;
    for(int i = 0; i < N; i++) {
        cin >> str;
        flg = false;
        for(int p = 0; p < str.size(); p++) {
            for(int s = 1; s < str.size() - p; s++) {
                string x = "";
                for(int j = 0; j < base.size(); j++) {
                    if(p + j * s < str.size()) x += str[p + j * s];
                }
                if(base == x) {flg = true; break;}
            }
            if(flg) break;
        }
        if(flg) cnt++;
    }

    cout << cnt << endl;
}
accuracy: 1
time_ms: 30
memory_kb: 3192
final_rank: 9

code_snippet: //Signboard
#include <iostream>

using namespace std;

int main() {
    int N;
    string base, str;
    bool flg;
    cin >> N;
    cin >> base;
    int cnt = 0;
    for(int i = 0; i < N; i++) {
        cin >> str;
        flg = false;
        for(int p = 0; p < str.size(); p++) {
            for(int s = 1; s < str.size() - p; s++) {
                string x = "";
                for(int j = 0; j < base.size(); j++) {
                    x += str[p + j * s];
                }
                if(base == x) {flg = true; break;}
            }
            if(flg) break;
        }
        if(flg) cnt++;
    }

    cout << cnt << endl;
}
accuracy: 0.4
time_ms: 20
memory_kb: 3232
final_rank: 20

code_snippet: #include <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
using namespace std;

int main() {
    int n;
    string s;
    cin >> n >> s;

    int cnt = 0;
    while (n--) {
        string in;
        cin >> in;

        bool flag = false;
        range (i, 1, 100) {
            if (i > in.size()) break;
            rep (j, i) {
                string tmp = "";
                for (int k = j; k < in.size(); k += i) tmp += in[k];
                rep (k, (int)tmp.size() - (int)s.size() + 1) {
                    string cmp = "";
                    rep (l, s.size()) cmp += tmp[k + l];
                    if (cmp == s) flag |= true;
                }
            }
        }
        cnt += flag;
    }

    cout << cnt << endl;

    return 0;
}
accuracy: 1
time_ms: 50
memory_kb: 3200
final_rank: 16

code_snippet: #include<stdio.h>
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <iterator>
#include <list>
#include <map>     
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <iomanip>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define ll long long
#define ld long double
#define loop(a,t) for(int a=0;a<t;a++) 
#define forever while(true)
#define Sort(a) sort(a.begin(),a.end())
#define Reverse(a) reverse(a.begin(),a.end())
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	string a;
	cin >> n >> a;
	int ans = 0;
	loop(i, n) {
		string str;
		cin >> str;
		string cnt = "";
		for (int i = 1; i < str.length(); i++) {
			for (int start = 0; start < str.length(); start++) {
				cnt = "";
				for (int j = start; j < str.length(); j += i)
				{
					cnt += str[j];
					if (cnt == a) 
					{
						ans++; goto H;
					}
				}
			}
		}
	H: {}
	}
	cout << ans << endl;
	return 0;
}
accuracy: 1
time_ms: 10
memory_kb: 3172
final_rank: 3

code_snippet: #include <bits/stdc++.h>
using namespace std;

using pii = pair<int, int>;
using vi = vector<int>;
using ll = long long;

int main() {
    int N;
    string name;
    cin >> N >> name;
    int ans = 0;
    for(int i = 0; i < N; ++i) {
        string s; cin >> s;
        bool ok = false;
        for(int w = 0; w < s.size(); ++w) {
            for(int l = 0; l < s.size(); ++l) {
                string tmp;
                for(int j = 0; j < name.size() && j * w + l < s.size(); ++j) {
                    tmp += s[j * w + l];
                }
                ok |= name == tmp;
            }
        }
        ans += ok;
    }
    cout << ans << endl;
}
accuracy: 1
time_ms: 50
memory_kb: 3172
final_rank: 14