結果
| 問題 | No.207 世界のなんとか |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-11-11 08:24:27 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 104 ms / 5,000 ms |
| コード長 | 691 bytes |
| 記録 | |
| コンパイル時間 | 3,068 ms |
| コンパイル使用メモリ | 82,032 KB |
| 実行使用メモリ | 47,800 KB |
| 最終ジャッジ日時 | 2026-04-03 10:22:16 |
| 合計ジャッジ時間 | 5,827 ms |
|
ジャッジサーバーID (参考情報) |
judge5_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b = sc.nextInt();
StringBuilder sb = new StringBuilder();
for (int i = a; i <= b; i++) {
if (isMatch(i)) {
sb.append(i).append("\n");
}
}
System.out.print(sb);
}
static boolean isMatch(int x) {
int sum = 0;
while (x > 0) {
int mod = x % 10;
if (mod == 3) {
return true;
}
sum += mod;
x /= 10;
}
return (sum % 3 == 0);
}
}
tenten