这能RE?????

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

AAAuc03 @ 2024-06-05 21:45:14

#include <bits/stdc++.h>
using namespace std;
map<int,int> a[10005];
int main()
{
    int n,q;
    scanf("%d%d",&n,&q);
    while(q--)
    {
        int i,j,k,h;
        scanf("%d",&h);
        if(h==1)
        {
            scanf("%d%d%d",&i,&j,&k);
            a[i][j]=k;
        }
        else
        {
            scanf("%d%d",&i,&j);
            printf("%d\n",a[i][j]);
        }
    }
    return 0;
}

by SF_bee @ 2024-06-05 21:56:57

题目的数据范围是1e5,可是你的代码是1e4


by SF_bee @ 2024-06-05 21:57:52

将第三行的10005改为100005即可


|