-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy path_5622.java
More file actions
61 lines (49 loc) ยท 1.2 KB
/
_5622.java
File metadata and controls
61 lines (49 loc) ยท 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package backjoon;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
// https://www.acmicpc.net/problem/5622
// ๋ค์ด์ผ
public class _5622 {
public static void main(String[] args) throws IOException {
//sol memory 11432 runtime 76
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
char[] dials = br.readLine().toCharArray();
int minSec = 0;
for(char c : dials){
switch (c){
case 'A': case 'B': case 'C':
minSec += 3;
break;
case 'D' : case 'E': case 'F' :
minSec += 4;
break;
case 'G' : case 'H': case 'I' :
minSec += 5;
break;
case 'J' : case 'K': case 'L' :
minSec += 6;
break;
case 'M' : case 'N': case 'O' :
minSec += 7;
break;
case 'P' : case 'Q': case 'R' : case 'S' :
minSec += 8;
break;
case 'T' : case 'U': case 'V' :
minSec += 9;
break;
case 'W' : case 'X': case 'Y' : case 'Z' :
minSec += 10;
break;
}
}
System.out.println(minSec);
}
}
/*
input
UNUCIC
output
36
*/