Submission #933033

# Submission time Handle Problem Language Result Execution time Memory
933033 2024-02-24T22:15:48 Z vjudge1 Selling RNA Strands (JOI16_selling_rna) C++17
35 / 100
1500 ms 8756 KB
#include <bits/stdc++.h>
#include <ios>
#include <string>
#include <vector>
using namespace std;
vector<string> strs;
int verifica(int i, string &a, string &b)
{
	if (strs[i].size() < a.size() || strs[i].size() < b.size()) return 0;
	string temp = strs[i].substr(0, a.size());
	if (a != temp) return 0;
	temp = strs[i].substr(strs[i].size()-b.size(), strs[i].size());
	if (b != temp) return 0;
	return 1;
}
int main() 
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n, m; cin >> n >> m; string s; 
	for (int i = 0; i < n; i++)
	{
		cin >> s; strs.push_back(s);
	}
	string a, b; int cnt;
	while (m--)
	{
		cin >> a >> b;
		cnt = 0;
		for (int i = 0; i < n; i++)
			cnt+= verifica(i, a, b);
		cout << cnt << '\n';
	}
	
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 141 ms 6228 KB Output is correct
2 Correct 670 ms 6628 KB Output is correct
3 Correct 212 ms 6416 KB Output is correct
4 Correct 293 ms 6504 KB Output is correct
5 Correct 580 ms 4220 KB Output is correct
6 Correct 585 ms 4436 KB Output is correct
7 Correct 412 ms 7248 KB Output is correct
8 Correct 1060 ms 8756 KB Output is correct
9 Correct 981 ms 8656 KB Output is correct
10 Correct 1404 ms 6084 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 1564 ms 2776 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 348 KB Output is correct
8 Correct 141 ms 6228 KB Output is correct
9 Correct 670 ms 6628 KB Output is correct
10 Correct 212 ms 6416 KB Output is correct
11 Correct 293 ms 6504 KB Output is correct
12 Correct 580 ms 4220 KB Output is correct
13 Correct 585 ms 4436 KB Output is correct
14 Correct 412 ms 7248 KB Output is correct
15 Correct 1060 ms 8756 KB Output is correct
16 Correct 981 ms 8656 KB Output is correct
17 Correct 1404 ms 6084 KB Output is correct
18 Execution timed out 1564 ms 2776 KB Time limit exceeded
19 Halted 0 ms 0 KB -