結果
| 問題 | No.542 1円玉と5円玉 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-06-16 18:49:28 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 72 ms / 2,000 ms |
| コード長 | 599 bytes |
| 記録 | |
| コンパイル時間 | 2,932 ms |
| コンパイル使用メモリ | 84,496 KB |
| 実行使用メモリ | 42,324 KB |
| 最終ジャッジ日時 | 2026-05-18 13:01:44 |
| 合計ジャッジ時間 | 4,748 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 |
ソースコード
import java.util.*;
import java.io.*;
import java.math.*;
public class No542 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a = sc.nextInt(), b = sc.nextInt();
HashSet<Integer> hs = new HashSet<Integer>();
for(int i = 0; i <= a; i++) {
for(int j = 0; j <= b; j++) {
hs.add(i + (j * 5));
}
}
ArrayList<Integer> k = new ArrayList<Integer>();
for(int h : hs) {
k.add(h);
}
Collections.sort(k);
k.remove(0);
for(int f : k) {
System.out.println(f);
}
}
}