求助!P3613全RE!

P3613 【深基15.例2】寄包柜

bobi0577 @ 2022-08-02 10:45:23

本来我提交的时候自信满满,没想到结果是~~

错误代码:

#include<bits/stdc++.h>
using namespace std;
int n,q,i,j,k,s;
vector< vector<int> >m(n+1);
int main(){
    cin>>n>>q;
    while(q--){
        cin>>s;
        if(s==1){
            cin>>i>>j>>k;
            if(m.size()<j+1)m.resize(j+1);
            m[i][j]=k;
        }
        else{
            cin>>i>>j;
            cout <<m[i][j]<<endl;
        }
    } 
}

求大佬帮助!


by ShouZheng_Observer @ 2022-08-02 11:07:57

@bobi0577 您提交之前可以现在本地测试


by ShouZheng_Observer @ 2022-08-02 11:10:25

m[i][j]=k;

这行RE


by bobi0577 @ 2022-08-02 15:11:43

@PhantomKnight 知道了,谢谢!


|