結果
| 問題 | No.207 世界のなんとか |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-11-11 08:24:27 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 60 ms / 5,000 ms |
| + 813µs | |
| コード長 | 691 bytes |
| 記録 | |
| コンパイル時間 | 1,504 ms |
| コンパイル使用メモリ | 84,784 KB |
| 実行使用メモリ | 45,928 KB |
| 最終ジャッジ日時 | 2026-08-23 11:29:53 |
| 合計ジャッジ時間 | 3,840 ms |
|
ジャッジサーバーID (参考情報) |
judge1_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