caohaoyu123 @ 2024-10-25 17:09:21
#include<bits/stdc++.h>
using namespace std;
int n,q;
map<int,int>mp[100010];
int main()
{
cin>>n>>q;
while(q--)
{
int x;
cin>>x;
if(x==1)
{
int u,v,w;
cin>>u>>v>>w;
mp[u][v]=w;
}
else
{
int u,v;
cin>>u>>v;
cout<<mp[u][v]<<endl;
}
}
return 0;
}
by zxdjmq @ 2024-10-25 17:28:07
@caohaoyu123 但是这题正解不就是map吗
by wwwidk1234 @ 2024-10-25 18:25:10
@caohaoyu123 单次查询