为什么这个桶错了

P7280 [COCI2020-2021#4] Pizza

joy2010WonderMaker @ 2021-01-26 20:37:15

#include<iostream>
using namespace std;
int s[101],n,a[100],m,k[100],b[100][100],ans;
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        s[a[i]]++;
    }
    cin>>m;
    for(int i=0;i<m;i++){
        cin>>k[i];
        for(int j=0;j<k[i];j++){
            cin>>b[i][j];
            if(s[b[i][j]]!=0){
                break;
            }
            if(j==k[i]-1){
                ans++;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

帮帮孩子吧


by Red_Lantern @ 2021-01-26 20:39:46

xswl


by skym @ 2021-01-26 21:28:57

a 数组没输入


by skym @ 2021-01-26 21:57:11

还有你跳出循环以后就不会再输入了


|