求助,死循环了

P7280 [COCI2020-2021#4] Pizza

xiaoxiaoxia @ 2023-05-27 08:40:07

#include<bits/stdc++.h>
using namespace std;
int t[100005], n, m, ans;
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        int x;
        cin>>x;
        t[x]=1;
    }
    scanf("%d",&m);
    for(int i=1;i<=m;i++)
    {
        int k;
        bool flag=true;
        cin>>k;
        for(int j=1;j<=k;i++)
        {
            int x;
            cin>>x;
            if(t[x])
            {
                flag=false; 
            } 

        }
        if(flag)
        {
            ans++;  
        }
    }
    printf("%d",&ans);
    return 0;
}

by ipcon @ 2023-05-27 08:47:18

for(int j=1;j<=k;i++) //i++?


by Intro_z_ @ 2023-05-27 09:42:48

for(int j=1;j<=k;i++) 红名大佬您是认真的??《i++》


by xiaoxiaoxia @ 2023-05-28 19:56:38

@wa____1 手打而已,还要加强,相较其他人来说,我也一般般。


by Intro_z_ @ 2023-05-28 21:11:01

@xiaoxiaoxia hhh


|