Submission #3518390


Source Code Expand

#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"

using namespace std;

const long long int MOD = 1000000007;

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


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

	cin >> N;
	string s;
	cin >> s;
	vector<string>vs(N);
	for (auto &i : vs)cin >> i;
	vector<long long int>dp(s.size() + 1);
	dp[0] = 1;
	for (int i = 0; i < s.size(); i++) {
		for (int j = 0; j < N; j++) {
			if (i + vs[j].size() > s.size())continue;
			bool flag = true;
			for (int k = 0; k < vs[j].size(); k++) {
				if (s[i + k] != vs[j][k])flag = false;
			}
			if (flag) {
				dp[i + vs[j].size()] += dp[i];
				dp[i + vs[j].size()] %= MOD;
			}
		}
	}
	cout << dp.back() << endl;
	return 0;
}

Submission Info

Submission Time
Task B - エターナルスタティックファイナル
User olphe
Language C++14 (GCC 5.4.1)
Score 60
Code Size 1046 Byte
Status AC
Exec Time 11 ms
Memory 384 KB

Judge Result

Set Name All
Score / Max Score 60 / 60
Status
AC × 108
Set Name Test Cases
All 00_sample00.txt, 00_sample01.txt, 00_sample02.txt, 00_sample03.txt, 00_sample04.txt, 01_random00.txt, 01_random01.txt, 01_random02.txt, 01_random03.txt, 01_random04.txt, 01_random05.txt, 01_random06.txt, 01_random07.txt, 01_random08.txt, 01_random09.txt, 01_random10.txt, 01_random11.txt, 01_random12.txt, 01_random13.txt, 01_random14.txt, 01_random15.txt, 01_random16.txt, 01_random17.txt, 01_random18.txt, 01_random19.txt, 01_random20.txt, 01_random21.txt, 01_random22.txt, 01_random23.txt, 01_random24.txt, 01_random25.txt, 01_random26.txt, 01_random27.txt, 01_random28.txt, 01_random29.txt, 01_random30.txt, 01_random31.txt, 01_random32.txt, 01_random33.txt, 01_random34.txt, 01_random35.txt, 01_random36.txt, 01_random37.txt, 01_random38.txt, 01_random39.txt, 01_random40.txt, 01_random41.txt, 01_random42.txt, 01_random43.txt, 01_random44.txt, 01_random45.txt, 01_random46.txt, 01_random47.txt, 01_random48.txt, 01_random49.txt, 01_random50.txt, 01_random51.txt, 01_random52.txt, 01_random53.txt, 01_random54.txt, 01_random55.txt, 01_random56.txt, 01_random57.txt, 01_random58.txt, 01_random59.txt, 01_random61.txt, 01_random62.txt, 01_random63.txt, 01_random64.txt, 01_random65.txt, 01_random66.txt, 01_random67.txt, 01_random68.txt, 01_random69.txt, 01_random70.txt, 01_random71.txt, 01_random72.txt, 01_random73.txt, 01_random74.txt, 01_random75.txt, 01_random76.txt, 01_random77.txt, 01_random78.txt, 01_random79.txt, 01_random80.txt, 01_random81.txt, 01_random82.txt, 01_random83.txt, 01_random84.txt, 01_random85.txt, 01_random86.txt, 01_random87.txt, 01_random88.txt, 01_random89.txt, 01_random90.txt, 01_random91.txt, 01_random92.txt, 01_random93.txt, 01_random94.txt, 01_random95.txt, 01_random96.txt, 01_random97.txt, 01_random98.txt, 01_random99.txt, 02_manual00.txt, 02_manual01.txt, 02_manual02.txt, 02_manual03.txt
Case Name Status Exec Time Memory
00_sample00.txt AC 1 ms 256 KB
00_sample01.txt AC 1 ms 256 KB
00_sample02.txt AC 1 ms 256 KB
00_sample03.txt AC 1 ms 256 KB
00_sample04.txt AC 1 ms 256 KB
01_random00.txt AC 8 ms 256 KB
01_random01.txt AC 7 ms 256 KB
01_random02.txt AC 1 ms 256 KB
01_random03.txt AC 1 ms 256 KB
01_random04.txt AC 2 ms 256 KB
01_random05.txt AC 10 ms 256 KB
01_random06.txt AC 5 ms 256 KB
01_random07.txt AC 1 ms 256 KB
01_random08.txt AC 1 ms 256 KB
01_random09.txt AC 2 ms 256 KB
01_random10.txt AC 2 ms 256 KB
01_random11.txt AC 3 ms 256 KB
01_random12.txt AC 5 ms 256 KB
01_random13.txt AC 2 ms 256 KB
01_random14.txt AC 4 ms 256 KB
01_random15.txt AC 2 ms 256 KB
01_random16.txt AC 3 ms 256 KB
01_random17.txt AC 3 ms 256 KB
01_random18.txt AC 1 ms 256 KB
01_random19.txt AC 4 ms 256 KB
01_random20.txt AC 4 ms 256 KB
01_random21.txt AC 8 ms 256 KB
01_random22.txt AC 1 ms 256 KB
01_random23.txt AC 1 ms 256 KB
01_random24.txt AC 2 ms 256 KB
01_random25.txt AC 1 ms 256 KB
01_random26.txt AC 2 ms 256 KB
01_random27.txt AC 7 ms 256 KB
01_random28.txt AC 1 ms 256 KB
01_random29.txt AC 1 ms 256 KB
01_random30.txt AC 1 ms 256 KB
01_random31.txt AC 5 ms 256 KB
01_random32.txt AC 2 ms 256 KB
01_random33.txt AC 4 ms 256 KB
01_random34.txt AC 9 ms 256 KB
01_random35.txt AC 6 ms 256 KB
01_random36.txt AC 3 ms 256 KB
01_random37.txt AC 2 ms 256 KB
01_random38.txt AC 10 ms 256 KB
01_random39.txt AC 11 ms 256 KB
01_random40.txt AC 3 ms 256 KB
01_random41.txt AC 5 ms 256 KB
01_random42.txt AC 7 ms 256 KB
01_random43.txt AC 10 ms 256 KB
01_random44.txt AC 3 ms 256 KB
01_random45.txt AC 4 ms 256 KB
01_random46.txt AC 10 ms 256 KB
01_random47.txt AC 5 ms 256 KB
01_random48.txt AC 4 ms 256 KB
01_random49.txt AC 3 ms 256 KB
01_random50.txt AC 2 ms 256 KB
01_random51.txt AC 2 ms 256 KB
01_random52.txt AC 1 ms 256 KB
01_random53.txt AC 2 ms 256 KB
01_random54.txt AC 7 ms 256 KB
01_random55.txt AC 8 ms 256 KB
01_random56.txt AC 1 ms 256 KB
01_random57.txt AC 2 ms 256 KB
01_random58.txt AC 4 ms 256 KB
01_random59.txt AC 2 ms 256 KB
01_random61.txt AC 8 ms 256 KB
01_random62.txt AC 2 ms 256 KB
01_random63.txt AC 9 ms 256 KB
01_random64.txt AC 2 ms 256 KB
01_random65.txt AC 4 ms 256 KB
01_random66.txt AC 7 ms 256 KB
01_random67.txt AC 1 ms 256 KB
01_random68.txt AC 6 ms 256 KB
01_random69.txt AC 5 ms 256 KB
01_random70.txt AC 2 ms 256 KB
01_random71.txt AC 2 ms 256 KB
01_random72.txt AC 8 ms 256 KB
01_random73.txt AC 10 ms 256 KB
01_random74.txt AC 7 ms 256 KB
01_random75.txt AC 3 ms 256 KB
01_random76.txt AC 4 ms 256 KB
01_random77.txt AC 7 ms 256 KB
01_random78.txt AC 3 ms 256 KB
01_random79.txt AC 5 ms 256 KB
01_random80.txt AC 6 ms 256 KB
01_random81.txt AC 3 ms 256 KB
01_random82.txt AC 2 ms 256 KB
01_random83.txt AC 2 ms 256 KB
01_random84.txt AC 2 ms 256 KB
01_random85.txt AC 1 ms 256 KB
01_random86.txt AC 10 ms 256 KB
01_random87.txt AC 6 ms 256 KB
01_random88.txt AC 3 ms 256 KB
01_random89.txt AC 7 ms 256 KB
01_random90.txt AC 4 ms 256 KB
01_random91.txt AC 8 ms 256 KB
01_random92.txt AC 4 ms 256 KB
01_random93.txt AC 2 ms 256 KB
01_random94.txt AC 8 ms 256 KB
01_random95.txt AC 3 ms 256 KB
01_random96.txt AC 5 ms 256 KB
01_random97.txt AC 2 ms 256 KB
01_random98.txt AC 2 ms 256 KB
01_random99.txt AC 3 ms 256 KB
02_manual00.txt AC 11 ms 256 KB
02_manual01.txt AC 1 ms 256 KB
02_manual02.txt AC 2 ms 384 KB
02_manual03.txt AC 1 ms 256 KB