結果
| 問題 | No.3708 Uncommon Time |
| コンテスト | |
| ユーザー |
ks2m
|
| 提出日時 | 2026-09-11 21:29:23 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 30 ms / 2,000 ms |
| + 744µs | |
| コード長 | 699 bytes |
| 記録 | |
| コンパイル時間 | 1,446 ms |
| コンパイル使用メモリ | 84,252 KB |
| 実行使用メモリ | 40,064 KB |
| 最終ジャッジ日時 | 2026-09-11 21:57:05 |
| 合計ジャッジ時間 | 5,344 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 55 |
ソースコード
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String[] sa = br.readLine().split(" ");
int m = Integer.parseInt(sa[0]);
int d = Integer.parseInt(sa[1]);
br.close();
int md = m * 100 + d;
if (isSosuu(md)) {
System.out.println("Yes");
} else {
System.out.println("No");
}
}
static boolean isSosuu(long n) {
if (n < 2) return false;
if (n == 2) return true;
long end = (int) Math.sqrt(n) + 1;
for (int i = 2; i <= end; i++) {
if (n % i == 0) {
return false;
}
}
return true;
}
}
ks2m