求大佬看看我的代码
查看原帖
求大佬看看我的代码
379114
Kerman0411楼主2023/9/4 21:25

我的代码结果都是RE,不知道问题在哪里

#include <iostream>
#include <vector>

using namespace std;

int n, q;
int x, y;
int ans = 0;

int main()
{
    // ios::sync_with_stdio(0);
    // cin.tie(0);
    cin >> n >> q;
    vector<vector<int> > a(n + 1);
    for ( int i = 1 ; i <= n ; ++ i )
    {
        int sz;
        cin >> sz;
        if ( a[i].size() <= sz )
        {
            a[i].resize(sz + 1);
        }
        for ( int j = 1 ; j <= sz ; ++ j )
        {
            cin >> a[i][j];
        }
    }
    for ( int i = 1 ; i <= q ; ++ i )
    {
        cin >> x >> y;
        ans ^= a[x][y];
        // cout << a[x - 1][y - 1] << endl;
    }
    cout << ans << endl;
    return 0;
}
2023/9/4 21:25
加载中...