QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#521273#5551. Selling RNA StrandsJooDdae10 1ms3876kbC++20533b2024-08-16 02:15:402024-08-16 02:15:42

Judging History

你现在查看的是最新测评结果

  • [2024-08-16 02:15:42]
  • 评测
  • 测评结果:10
  • 用时:1ms
  • 内存:3876kb
  • [2024-08-16 02:15:40]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int n, m;
string s[111];

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> m;
    for(int i=1;i<=n;i++) cin >> s[i];

    for(int i=1;i<=m;i++) {
        string L, R; cin >> L >> R;

        int ans = 0;
        for(int j=1;j<=n;j++) if(max(L.size(), R.size()) <= s[j].size()) {
            ans += s[j].substr(0, L.size()) == L && s[j].substr(s[j].size()-R.size(), R.size()) == R;
        }
        cout << ans << "\n";
    }
}

詳細信息

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 3576kb

input:

100 100
A
G
AGC
AUA
C
CCA
CGGAG
CCGAG
GACA
UCAAC
CUUAU
AC
A
CGUA
UAUG
UGCGA
GCU
GUUAU
UAAU
A
UAA
U
CGCCC
GCG
U
AUUC
GACA
CC
AG
GUCGU
UUCA
AGGC
G
CU
UG
CUUA
CUAU
AA
A
GUUG
GGU
UU
C
GCUG
C
GUGGA
C
UAU
UAG
GC
GUU
GC
UCUCA
U
AA
AG
C
GGU
GC
CCUG
CCUU
GG
CAGCU
UAGGU
GGCUC
CUACG
UGC
UU
UAAUG
UGGCA
CAA
UGAG...

output:

9
1
11
1
1
2
4
3
11
6
1
2
1
1
4
2
1
11
10
1
5
1
1
1
1
11
1
13
1
1
3
1
11
1
11
11
1
2
2
1
1
10
1
1
1
2
4
2
1
13
10
1
1
1
2
1
1
4
1
2
1
1
9
9
13
2
1
2
9
2
1
10
2
2
1
9
1
1
1
1
1
1
1
9
1
1
11
11
1
1
1
1
2
13
1
2
1
13
1
1

result:

ok 100 lines

Test #2:

score: 10
Accepted
time: 0ms
memory: 3556kb

input:

100 100
U
CUAG
AUCA
UAACG
U
GG
CUCCA
G
G
UGCCA
CGA
ACAAU
GUUA
GUAGA
AUCU
C
GC
ACACG
UUG
CCC
U
UUGUC
AUC
GAA
U
CGGA
U
AGA
GCU
AAG
CUA
UCGG
GGG
UCG
GGAU
U
CGA
CCAUG
ACG
G
C
CUU
GUCU
UUAU
UACU
UCC
UGAAG
GCAAU
CUCG
GAG
U
ACC
CUAU
CU
UU
AAGUA
AGGU
CGAA
U
GCU
AA
CAA
G
UAGGG
A
UCU
A
AA
G
UAC
GC
CAC
AGUGA
U...

output:

1
5
1
8
14
1
5
1
12
1
2
2
12
1
1
6
8
1
1
4
5
2
1
1
3
1
1
1
2
2
1
1
2
1
1
14
1
1
1
1
2
1
2
1
1
14
1
1
2
8
1
14
2
12
1
1
1
7
1
2
1
1
12
5
1
1
1
2
12
1
1
14
2
8
1
1
1
6
3
1
2
1
5
12
1
1
1
1
3
1
1
12
14
1
14
1
4
1
2
14

result:

ok 100 lines

Test #3:

score: 10
Accepted
time: 0ms
memory: 3648kb

input:

100 100
GACC
CACCU
GGCC
UGUA
UCAG
UUUGU
GU
AGUAC
ACUG
UAGAG
UCAA
GGCA
G
GGUU
CGA
A
G
UUUGG
CGA
UG
AU
GAC
AA
GGGA
AGA
AC
AGCAG
AGU
A
UUUAA
G
UGC
ACGUC
A
AUAAA
UAAAA
CGU
AUGAC
GAUA
UGUCC
AACU
AAUA
CUAA
C
CG
G
GGC
UGACC
AUGU
U
UA
GAAUA
AG
UA
UGGAC
AAG
CCGC
UA
CGCAA
A
CCG
UAAAA
GAG
CGG
UA
GAUG
GGA
UCAUU...

output:

2
4
9
9
1
3
9
1
6
11
1
1
1
1
1
11
2
1
2
9
4
5
1
2
1
11
3
1
4
2
1
1
9
1
11
1
11
4
11
1
2
9
1
1
1
1
1
1
2
1
4
1
1
4
9
9
3
11
1
1
1
1
3
5
6
1
2
1
4
1
2
2
6
9
1
1
5
1
4
3
2
1
1
4
10
1
2
1
2
2
11
2
1
1
2
3
1
1
1
1

result:

ok 100 lines

Test #4:

score: 10
Accepted
time: 0ms
memory: 3584kb

input:

100 100
CCG
UAAUA
AGUUU
GAG
GUAGC
A
AAUC
UC
ACCC
A
U
UCGG
AG
G
AG
AC
AAGAA
GCGAU
CGUC
G
AG
UUAAU
CGUGU
GUCG
A
UA
AU
GAAAC
AUG
CGUG
ACGG
G
C
AUG
GAUU
ACGG
GGA
CU
UG
U
AAA
C
UAUGU
UAC
CUA
ACC
CGAUG
GCC
UACG
CCA
UAAU
UUAAA
C
UA
GACA
UUGUC
AGCU
UCCA
AAAA
CUUA
GU
UCCGA
C
UUU
AG
UC
UAAU
GGG
CUCCC
C
UUU
UG...

output:

1
1
2
4
9
1
2
2
2
12
1
1
10
2
10
4
12
5
2
1
1
10
8
4
2
5
8
1
1
4
1
3
9
1
1
1
1
2
4
9
2
4
2
2
1
1
1
8
1
1
1
9
1
7
4
1
4
8
1
3
8
10
4
8
8
2
2
4
2
9
2
2
1
1
1
1
1
1
1
2
2
2
1
4
2
9
2
2
8
9
1
2
2
8
6
4
4
12
2
5

result:

ok 100 lines

Test #5:

score: 10
Accepted
time: 1ms
memory: 3580kb

input:

100 100
CAGAA
CU
GAUCU
AAAC
AUGGG
CCUAC
G
C
A
UC
UUCAU
GUCAA
UUA
GG
UG
GCU
GGGCU
UUUA
CAG
G
G
AAUU
ACAU
AUAC
UA
C
UUCC
CA
CUC
A
UA
GGUC
UGG
AGG
GUUCU
AA
ACCC
CAUG
CGCA
A
AU
GAGGU
GG
UCU
AA
AGUC
AGC
AACUA
CUGAC
GGACU
CCGG
AGGA
GAG
UAAG
GA
ACGA
A
UCUGG
CAG
GCAA
GAG
CC
UAAUC
UUGA
AG
U
GGG
AAACG
UA
ACGA...

output:

1
1
13
1
1
1
2
2
1
2
1
1
2
1
8
8
8
1
2
2
4
2
2
2
2
1
3
2
1
2
4
1
1
5
13
4
1
6
13
2
2
10
1
2
2
2
1
5
10
1
1
8
8
8
1
10
1
1
4
3
2
10
3
1
1
5
2
1
5
1
2
3
1
6
1
1
13
1
10
2
2
1
1
1
1
13
3
10
3
2
1
1
2
2
2
5
1
2
10
1

result:

ok 100 lines

Test #6:

score: 10
Accepted
time: 0ms
memory: 3876kb

input:

100 100
UG
G
AA
GA
G
ACAC
GGAAG
GAGU
UG
UUAA
UG
U
AGUUA
CA
C
G
CCCG
U
UAAG
UCUG
CGGU
A
CAC
ACGA
CA
A
UC
GAAUC
A
GAGG
GG
GGG
CCCUC
GACGU
GGUG
GCG
CCAG
C
AUAU
A
AG
UGU
UCGC
UC
AUA
ACGCC
A
GCUA
CCU
G
AGC
GG
GCAUG
GGGUG
C
CCCC
GG
A
AG
AC
UA
CACG
AU
GAG
G
GG
GACC
ACAAC
GCGUG
C
GAA
C
UGCU
GC
ACGGA
AUG
GCA...

output:

14
1
7
5
1
4
7
1
24
4
14
24
1
4
7
1
1
24
1
1
1
4
7
6
3
1
14
4
1
1
1
7
7
6
14
1
24
1
9
1
1
24
7
24
14
9
1
1
1
1
7
9
24
24
7
5
1
3
24
1
1
24
1
3
2
1
9
4
2
2
1
14
7
5
14
14
1
1
2
2
4
24
2
14
1
1
14
3
9
24
7
1
1
4
1
24
9
5
4
14

result:

ok 100 lines

Test #7:

score: 10
Accepted
time: 0ms
memory: 3872kb

input:

100 100
AG
ACACC
GAG
GG
C
AC
AGCA
AAUGU
AGU
UUA
UG
UAC
UU
U
G
G
CUAA
CCG
AAGU
G
CAAU
CCCUA
CCG
G
GACAA
C
CCCAA
UUUCG
UG
C
AAUGC
GCA
A
C
AAUCC
UCGC
UG
GU
GUAUG
CUGG
UUCA
AC
AACU
UA
GAAG
CGGC
ACU
GUAAU
GGGGA
UGAUU
GCA
CUGAG
CUA
UUGGU
GC
CCA
GCAU
AC
U
GG
UGCA
CUACC
GAUAC
UACG
CAUC
GG
GAG
CAU
AUAA
UUA
C...

output:

2
6
1
1
2
13
1
1
4
1
3
2
2
1
1
6
13
1
1
6
2
11
1
4
1
1
8
3
4
1
1
2
2
1
6
1
1
1
3
11
2
2
2
1
1
6
1
6
1
1
8
1
1
1
3
1
2
2
1
1
4
8
1
1
13
1
3
2
1
1
11
3
13
1
1
11
1
4
2
1
13
2
6
11
1
1
6
3
1
1
13
4
3
6
11
6
3
1
1
2

result:

ok 100 lines

Subtask #2:

score: 0
Runtime Error

Dependency #1:

100%
Accepted

Test #8:

score: 0
Runtime Error

input:

2000 2000
ACUGGAACAGAAUCGUUCGAAUCAACAUUUCCCUCGCUUUUGGCUCCCCUCAGUAAUCUUUGUAGUACCGGCCUUCGCGAUCUGCGGCCAUCCCCUCCCAGUUGUUCGAGUUAGGGCAUGCUCUGCAGCGUUGAUUCAGUC
ACUGGAACAGAAUCGUUCGAAUCAACAUUUCCCUCGCUUUUGGCUCCCCUCAGUAAUCUUUGUAGUACCGGCCUUCGCGAUCUGCGGCCAUCCCCUCCCAGUUGUUCGAGUUAGGGCAUGCUCUGCAGCGUUGAUUCAGCAGAUCCUA...

output:


result:


Subtask #3:

score: 0
Runtime Error

Dependency #1:

100%
Accepted

Test #18:

score: 0
Runtime Error

input:

50000 50000
UA
UU
AU
AU
UA
UA
AU
UU
UU
UU
UU
UU
UU
UA
UU
UU
UA
UA
UU
UU
UA
UU
UU
UU
AU
UA
UA
AU
UU
UU
UU
UA
UU
AU
UU
UU
AU
UA
UU
UA
UU
AU
UU
AU
UU
UU
UA
UU
UA
UU
UA
UA
UU
AU
AU
UA
UU
UU
AU
UU
UA
UU
UU
UU
UA
UU
UU
UU
UU
UU
UA
UA
UA
AU
UU
AU
UU
UA
UA
AU
UA
UU
AU
UU
AU
UA
UU
UA
UU
UU
UU
UU
UA
AU
UA
UU
...

output:


result:


Subtask #4:

score: 0
Skipped

Dependency #1:

100%
Accepted

Dependency #2:

0%