結果

問題 No.1692 Expectations
ユーザー ks2m
提出日時 2021-10-01 21:24:08
言語 Java
(openjdk 23)
結果
AC  
実行時間 1,046 ms / 2,000 ms
コード長 490 bytes
コンパイル時間 3,858 ms
コンパイル使用メモリ 82,236 KB
実行使用メモリ 70,400 KB
最終ジャッジ日時 2024-07-19 10:26:17
合計ジャッジ時間 12,498 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		Set<Integer> set = new HashSet<>();
		for (int i = 0; i < n; i++) {
			set.add(sc.nextInt());
		}
		sc.close();

		int max = set.size();
		int min = 0;
		if (set.size() == 1 && n == m) {
			min = 1;
		}
		System.out.println(max + " " + min);
	}
}
0