Skip to content

Instantly share code, notes, and snippets.

@chermehdi
Created January 26, 2018 21:49
Show Gist options
  • Save chermehdi/81745b94c21deceb1a864d87e3a8da97 to your computer and use it in GitHub Desktop.
Save chermehdi/81745b94c21deceb1a864d87e3a8da97 to your computer and use it in GitHub Desktop.
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <map>
using namespace std;
const int N = 1e6;
int main(){
int arr[3];
for(int i = 0; i < 3; i++) cin >> arr[i];
sort(arr, arr + 3);
string s; cin >> s;
map<char, int> m;
m['C'] = arr[2];
m['B'] = arr[1];
m['A'] = arr[0];
for(int i = 0; i < s.length(); i++){
if(i > 0) cout << " ";
cout << m[s[i]];
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment