結果
| 問題 | No.441 和か積 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-11-11 22:26:00 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,142 bytes |
| 記録 | |
| コンパイル時間 | 4,590 ms |
| コンパイル使用メモリ | 83,168 KB |
| 実行使用メモリ | 41,832 KB |
| 最終ジャッジ日時 | 2026-05-19 21:06:49 |
| 合計ジャッジ時間 | 6,201 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 4 |
ソースコード
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);
}
}
}