QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#706685#8334. GenelanhuoWA 3ms66112kbC++17828b2024-11-03 12:58:552024-11-03 12:58:57

Judging History

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

  • [2024-11-03 12:58:57]
  • 评测
  • 测评结果:WA
  • 用时:3ms
  • 内存:66112kb
  • [2024-11-03 12:58:55]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define _ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl '\n'
#define int long long 
#define pre(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,a,b) for(int i=a;i>=b;i--)
#define pii pair<int,int>
const int N = 1e6 + 10,inf = 0x3f3f3f3f3f3f3f3f;
int n,m,l,z;
string s[N],str[N];
void solve()
{
	cin >> n >> m >> l >> z;
	pre(i,1,n) cin >> s[i];
	pre(i,1,m) cin >> str[i];
	int ans = 0;
	pre(i,1,n)
	{
		pre(j,1,m)
		{
			int cnt = 0,f = 1;
			for(int k=l-1;k>=0;k--)
			{
				if(s[i][k] != str[j][k])
					cnt ++ ;
				if(cnt > z){
					f = 0;
					break;
				}
			}
			if(f)
			{
				ans ++ ;
				break;
			}
		}
	}
	cout << ans << endl;
}

signed main()
{
	_;
	int t = 1;
	//cin >> t;
	while(t -- )
		solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 3ms
memory: 66112kb

input:

6 4 4 1
kaki
kika
manu
nana
tepu
tero
kaka
mana
teri
anan

output:

5

result:

wrong answer 1st numbers differ - expected: '2', found: '5'