1 条题解

  • 0
    @ 2025-12-7 8:50:12
    #include<bits/stdc++.h>
    using namespace std;
    #define int long long
    map<int,int>mp;
    signed main()
    {
    	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    	int q;cin>>q;
    	while(q--)
    	{
    		int op,x,y;cin>>op;
    		if(op==0)
    		{
    			cin>>x>>y;
    			mp[x]=y;
    		}
    		else
    		{
    			cin>>x;
    			cout<<mp[x]<<'\n';
    		}
    	}
    	return 0;
    }
    
    • 1

    *【STL:map】关联数组(Associative Array)

    信息

    ID
    8116
    时间
    1000ms
    内存
    1024MiB
    难度
    7
    标签
    递交数
    108
    已通过
    27
    上传者