結果

問題 No.441 和か積
ユーザー GrenacheGrenache
提出日時 2016-11-11 22:26:00
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,142 bytes
コンパイル時間 3,593 ms
コンパイル使用メモリ 77,676 KB
実行使用メモリ 41,784 KB
最終ジャッジ日時 2024-05-04 02:20:25
合計ジャッジ時間 7,692 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 115 ms
40,992 KB
testcase_01 AC 111 ms
40,740 KB
testcase_02 AC 113 ms
41,240 KB
testcase_03 AC 105 ms
39,876 KB
testcase_04 AC 114 ms
41,240 KB
testcase_05 AC 113 ms
41,356 KB
testcase_06 AC 116 ms
41,128 KB
testcase_07 AC 110 ms
41,124 KB
testcase_08 AC 111 ms
41,404 KB
testcase_09 AC 113 ms
41,208 KB
testcase_10 AC 101 ms
40,304 KB
testcase_11 AC 107 ms
41,172 KB
testcase_12 WA -
testcase_13 AC 100 ms
39,996 KB
testcase_14 AC 108 ms
40,980 KB
testcase_15 AC 98 ms
39,984 KB
testcase_16 AC 108 ms
41,020 KB
testcase_17 AC 101 ms
40,256 KB
testcase_18 AC 98 ms
40,328 KB
testcase_19 AC 112 ms
40,084 KB
testcase_20 AC 113 ms
41,320 KB
testcase_21 AC 103 ms
39,888 KB
testcase_22 AC 104 ms
40,292 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 108 ms
41,424 KB
testcase_26 WA -
testcase_27 AC 93 ms
40,016 KB
testcase_28 AC 112 ms
41,464 KB
testcase_29 AC 109 ms
41,456 KB
testcase_30 AC 113 ms
41,508 KB
testcase_31 AC 98 ms
39,988 KB
testcase_32 AC 111 ms
41,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder441 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		String a = sc.next();
		String b = sc.next();

		if (isZero(a) && isZero(b)) {
			pr.println("E");
		} else if (isZero(a) && !isZero(b)) {
			pr.println("S");
		} else if (!isZero(a) && isZero(b)) {
			pr.println("S");
		} else if (a.length() == 1 && b.length() == 1) {
			int aa = Integer.parseInt(a);
			int bb = Integer.parseInt(b);

			if (aa + bb > aa * bb) {
				pr.println("S");
			} else if (aa + bb < aa * bb) {
				pr.println("P");
			} else {
				pr.println("E");
			}
		} else {
			pr.println("P");
		}
	}

	private static boolean isZero(String a) {
		if (a.length() == 1 && Integer.parseInt(a) == 0) {
			return true;
		} else {
			return false;
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0