Submission #144299


Source Code Expand

Copy
import java.util.Scanner;
import java.util.Arrays;

public class Main {
	public static void main(String[] args){
		Scanner keyboard = new Scanner(System.in);
		String S = keyboard.nextLine();
		int output[] = new int[S.length()];



		for (int i=0; i<S.length(); i++){
			if (S.charAt(i) == 'O' || S.charAt(i) == 'D'){
				output[i] = 0;
			} else if (S.charAt(i) == 'I'){
				output[i] = 1;
			} else if (S.charAt(i) == 'Z'){
				output[i] = 2;
			} else if (S.charAt(i) == 'S'){
				output[i] = 5;
			} else if (S.charAt(i) == 'B'){
				output[i] = 8;
			} else {
				output[i] = Character.getNumericValue(S.charAt(i));
			}
		}

		for (int i=0; i<output.length; i++){
			System.out.print(output[i]);
		}

		System.out.print("\n");
		

		/*
		char[] result = new char[S.length()];

		int count = 0;
		for (char letter : result){
			letter = (char)output[count];
			count++;
		}
		System.out.println(result);
		*/
	}
}

Submission Info

Submission Time
Task A - お買い物クライシス
User coffeeapple
Language Java (OpenJDK 1.7.0)
Score 100
Code Size 964 Byte
Status
Exec Time 511 ms
Memory 18492 KB

Test Cases

Set Name Score / Max Score Test Cases
All 100 / 100 char_0.txt, char_1.txt, char_2.txt, char_3.txt, char_4.txt, char_5.txt, char_6.txt, char_7.txt, char_8.txt, char_9.txt, char_B.txt, char_D.txt, char_I.txt, char_O.txt, char_S.txt, char_Z.txt, chars_1.txt, chars_2.txt, chars_3.txt, chars_4.txt, chars_5.txt, hand_1.txt, hand_2.txt, hand_3.txt, hand_4.txt, hand_5.txt, num_1.txt, num_2.txt, num_3.txt, random_1.txt, random_10.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt
Case Name Status Exec Time Memory
char_0.txt 437 ms 18292 KB
char_1.txt 470 ms 18364 KB
char_2.txt 434 ms 18356 KB
char_3.txt 486 ms 18488 KB
char_4.txt 445 ms 18364 KB
char_5.txt 438 ms 18464 KB
char_6.txt 470 ms 18324 KB
char_7.txt 468 ms 18356 KB
char_8.txt 462 ms 18328 KB
char_9.txt 455 ms 18472 KB
char_B.txt 465 ms 18364 KB
char_D.txt 444 ms 18236 KB
char_I.txt 475 ms 18340 KB
char_O.txt 427 ms 18348 KB
char_S.txt 449 ms 18340 KB
char_Z.txt 488 ms 18320 KB
chars_1.txt 478 ms 18476 KB
chars_2.txt 480 ms 18484 KB
chars_3.txt 478 ms 18348 KB
chars_4.txt 434 ms 18340 KB
chars_5.txt 431 ms 18448 KB
hand_1.txt 511 ms 18356 KB
hand_2.txt 492 ms 18352 KB
hand_3.txt 470 ms 18416 KB
hand_4.txt 478 ms 18476 KB
hand_5.txt 494 ms 18360 KB
num_1.txt 434 ms 18344 KB
num_2.txt 450 ms 18448 KB
num_3.txt 501 ms 18348 KB
random_1.txt 425 ms 18480 KB
random_10.txt 422 ms 18356 KB
random_2.txt 443 ms 18492 KB
random_3.txt 436 ms 18348 KB
random_4.txt 490 ms 18360 KB
random_5.txt 437 ms 18468 KB
random_6.txt 438 ms 18312 KB
random_7.txt 425 ms 18340 KB
random_8.txt 443 ms 18340 KB
random_9.txt 436 ms 18360 KB
sample_1.txt 423 ms 18468 KB
sample_2.txt 451 ms 18484 KB
sample_3.txt 469 ms 18364 KB