# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
931401 | AtinaR | 고장난 휴대전화기 (COCI14_mobitel) | C++14 | 1 ms | 436 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
map<char,string> mapa;
string f(int num)
{
if(num==1)return "";
if(num==2)return "abc";
else if(num==3)return "def";
else if(num==4)return "ghi";
else if(num==5)return "jkl";
else if(num==6)return "mno";
else if(num==7)return "pqrs";
else if(num==8)return "tuv";
else if(num==9)return "wxyz";
}
int main()
{
int niza[9];
for(int i=0; i<9; i++)
{
cin>>niza[i];
}
string s;
cin>>s;
for(int i=0; i<9; i++)
{
int act_as=niza[i];
string keys=f(act_as);
int cnt=1;
for(auto x:keys)
{
string tmp="";
for(int k=0; k<cnt; k++)tmp+=(i+1)+'0';
mapa[x]=tmp;
cnt++;
}
}
for(int i=0; i<s.size(); i++)
{
cout<<mapa[s[i]];
if(i<s.size()-1)
{
if(mapa[s[i]][0]==mapa[s[i+1]][0])cout<<"#";
}
}
cout<<endl;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |