1 solutions

  • 0
    @ 2024-7-18 11:43:57
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int n,m;
    	cin>>n>>m;
    	map<string,int> h;
    	for(int i=1;i<=n;i++)
    	{
    		string a;
    		int b;
    		cin>>a>>b;
    		h[a]=b;
    	}
    	for(int i=1;i<=m;i++)
    	{
    		string a;
    		cin>>a;
    		cout<<h[a]<<endl;
    	}
    	return 0;
    }
    
    • 1

    Information

    ID
    156
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    40
    Accepted
    18
    Uploaded By