QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#665531#8334. Genesw7777WA 0ms3792kbC++201.0kb2024-10-22 13:53:582024-10-22 13:53:59

Judging History

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

  • [2024-10-22 13:53:59]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3792kb
  • [2024-10-22 13:53:58]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
const int M=61000;
const int N=301;
bitset<N> ch[M][26];//每个bitset表示第i位第j个字母第k个字符串是否和j不同
bitset<N> man;
int ans[N];
int n,q,m,K;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    cin>>n>>q>>m>>K;
    for(int i=1;i<=n;i++){
        string s;cin>>s;
        s=" "+s;
        for(int j=1;j<=m;j++){
            for(int k=0;k<26;k++){
                if(s[j]-'a'!=k) ch[j][k][i]=1;//不同
            }
        }
    }
    // cout<<ch[1]['k'-'a']<<endl;
    for(int i=1;i<=q;i++){
        string s;cin>>s;
        s=" "+s;
        int cnt=n;
        for(int j=1;j<=n;j++) ans[j]=0;
        for(int j=1;j<=m;j++){
            man.set();
            man&=ch[j][s[j]-'a'];
            for(auto k=man._Find_first();k!=man.size();k=man._Find_next(k)){
                if(++ans[k]>K) cnt--;
            }
        }
        cout<<cnt<<endl;
    }
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3792kb

input:

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

output:

-3
-4
-6
-12

result:

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