1506 | 2022. 11. 21 14:50:43 | teodorbatkai | Morze (60 pont) | cpp11 | Accepted 60/60 | 3ms | 3724 KiB |
#include <bits/stdc++.h>
using namespace std;
int main(){
string be;
cin >> be;
int l = be.length() / 5;
for(int i = 0; i < l; i++){
if(be[i*5] == '-' && be[i*5+4] == '-'){
cout << "0";
}else if(be[i*5] == '.' && be[i*5+1] == '-'){
cout << "1";
}else if(be[i*5] == '.' && be[i*5+2] == '-'){
cout << "2";
}else if(be[i*5] == '.' && be[i*5+3] == '-'){
cout << "3";
}else if(be[i*5] == '.' && be[i*5+4] == '-'){
cout << "4";
}else if(be[i*5] == '.' && be[i*5+4] == '.'){
cout << "5";
}else if(be[i*5] == '-' && be[i*5+1] == '.'){
cout << "6";
}else if(be[i*5] == '-' && be[i*5+2] == '.'){
cout << "7";
}else if(be[i*5] == '-' && be[i*5+3] == '.'){
cout << "8";
}else if(be[i*5] == '-' && be[i*5+4] == '.'){
cout << "9";
}
}
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
base | 60/60 | ||||||
1 | Accepted | 0/0 | 3ms | 1812 KiB | |||
2 | Accepted | 0/0 | 2ms | 2064 KiB | |||
3 | Accepted | 3/3 | 2ms | 2260 KiB | |||
4 | Accepted | 3/3 | 2ms | 2408 KiB | |||
5 | Accepted | 3/3 | 2ms | 2616 KiB | |||
6 | Accepted | 3/3 | 2ms | 2824 KiB | |||
7 | Accepted | 3/3 | 2ms | 2896 KiB | |||
8 | Accepted | 3/3 | 2ms | 3020 KiB | |||
9 | Accepted | 4/4 | 2ms | 3228 KiB | |||
10 | Accepted | 4/4 | 2ms | 3304 KiB | |||
11 | Accepted | 4/4 | 2ms | 3312 KiB | |||
12 | Accepted | 7/7 | 2ms | 3436 KiB | |||
13 | Accepted | 7/7 | 2ms | 3568 KiB | |||
14 | Accepted | 8/8 | 2ms | 3648 KiB | |||
15 | Accepted | 8/8 | 2ms | 3724 KiB |