# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
468562 | 2021-08-28T18:13:01 Z | ala2 | 고장난 휴대전화기 (COCI14_mobitel) | C++14 | 1 ms | 296 KB |
#include <bits/stdc++.h> using namespace std; int a[1000100]; map<char,int>m; map<int,string>m2; int main() { for(int i=1;i<=9;i++) { int x; cin>>x; a[x]=i; } m['a']=m['b']=m['c']=2; m['d']=m['e']=m['f']=3; m['g']=m['h']=m['i']=4; m['j']=m['k']=m['l']=5; m['m']=m['n']=m['o']=6; m['p']=m['q']=m['r']=m['s']=7; m['t']=m['u']=m['v']=8; m['w']=m['x']=m['y']=m['z']=9; m2[2]="abc"; m2[3]="def"; m2[4]="ghi"; m2[5]="jkl"; m2[6]="mno"; m2[7]="pqrs"; m2[8]="tuv"; m2[9]="wxyz"; string s; cin>>s; for(int i=0;i<s.size();i++) { if(i>0&&m[s[i]]==m[s[i-1]]) cout<<'#'; int x=m[s[i]]; string c=m2[x]; for(int j=0 ; ;j++ ) { cout<<a[x]; if(c[j]==s[i]) break; } } cout<<endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
2 | Correct | 1 ms | 204 KB | Output is correct |
3 | Correct | 1 ms | 296 KB | Output is correct |
4 | Correct | 1 ms | 204 KB | Output is correct |
5 | Correct | 1 ms | 204 KB | Output is correct |
6 | Correct | 1 ms | 204 KB | Output is correct |
7 | Correct | 1 ms | 204 KB | Output is correct |
8 | Correct | 1 ms | 204 KB | Output is correct |
9 | Correct | 1 ms | 204 KB | Output is correct |
10 | Correct | 1 ms | 204 KB | Output is correct |