QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#623754#7618. Pattern SearchLX1288#WA 1ms3868kbC++14453b2024-10-09 13:54:492024-10-09 13:54:52

Judging History

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

  • [2024-10-09 13:54:52]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3868kb
  • [2024-10-09 13:54:49]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
const int M=1005;
int tt,n,m;
string s,t;
int main(){
	ios::sync_with_stdio(false),cin.tie(0);
	cin>>tt;
	while(tt--){
		int cnt[M]={},cnt1[M]={};
		cin>>s>>t;
		for(int i=0;i<t.size();i++)cnt[t[i]]++;
		for(int i=0;i<s.size();i++)cnt1[s[i]]++;
		int mi=1e9;
		for(int i='a';i<='z';i++){
			
			if(cnt[i]){
				mi=min(mi,cnt1[i]/cnt[i]);
			}
		}
		printf("%d\n",mi);
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3868kb

input:

2
bajkaaall aal
abca cba

output:

2
1

result:

ok 2 number(s): "2 1"

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3848kb

input:

16
a a
a b
b a
aa a
ab aa
ab b
ab c
aaz az
abcde edcba
aaaaaaaaaaaabbb aaaaaaaaabb
aaaaaazz az
aaaaaaaaaz zzzzz
gggggggggggggggggggge ggggeeee
hyphyphyphyphyphyphyphyphyphyphyphyp eeeeeeeeee
hyphyphyphyphyphyphyphyphyphyphyphype eeteeteeteet
aaaabbbbbbcccccccc aaabbbbbcccccc

output:

1
0
0
2
0
1
0
1
1
1
2
0
0
0
0
1

result:

wrong answer 10th numbers differ - expected: '2', found: '1'