$O(1)$
#include<iostream> #include<map> #include<string> #include<math.h> using namespace std; map<string, int> mp = { { "black",0 },{ "brown",1 },{ "red",2 },{ "orange",3 },{ "yellow",4 },{ "green",5 },{ "blue",6 },{ "violet",7 },{ "grey",8 },{ "white",9 } }; string a, b, c; int r; int main() { cin >> a >> b >> c; printf("%lld", (mp[a] * 10 + mp[b])*(long long)pow(10, mp[c])); return 0; }
댓글 없음 :
댓글 쓰기