请问这个为什么在洛谷会CE的 ,在线编译器能过,这道题交不了。。。
查看原帖
请问这个为什么在洛谷会CE的 ,在线编译器能过,这道题交不了。。。
345391
Smiling0316楼主2021/4/8 19:51
#include <iostream>
#include <vector>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;
    
    vector< vector<int> > nums(n + 1);
    while(m--)
    {
        int t, i, j, k;
        cin >> t;
        if(t == 1)
        {
            cin >> i >> j >> k;
            if(nums[i].size() < j +1) 
                nums[i].resize(j + 1);
            nums[i][j] = k;
        }
        else
        {
            cin >> i >> j;
            cout << nums[i][j] << endl;
        }
    }
    return 0;
}
2021/4/8 19:51
加载中...