結果
問題 |
No.3196 Unique Nickname
|
ユーザー |
|
提出日時 | 2025-07-11 21:23:27 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,343 bytes |
コンパイル時間 | 4,106 ms |
コンパイル使用メモリ | 80,260 KB |
実行使用メモリ | 43,512 KB |
最終ジャッジ日時 | 2025-07-11 21:23:36 |
合計ジャッジ時間 | 5,946 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 15 WA * 5 |
ソースコード
import java.io.*; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { int n = sc.nextInt(); Set<String> s = new HashSet<String>(); for (int i = 0; i < 2 * n; i++) { s.add(sc.next()); } out.println(s.size() == 2 * n ? "Yes" : "No"); out.close(); } static Kattio sc = new Kattio(); static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); static class Kattio { static BufferedReader r; static StringTokenizer st; public Kattio() { r = new BufferedReader(new InputStreamReader(System.in)); } public String next() { try { while (st == null || !st.hasMoreTokens()) { st = new StringTokenizer(r.readLine()); } return st.nextToken(); } catch (Exception e) { return null; } } public int nextInt() { return Integer.parseInt(next()); } public long nextLong() { return Long.parseLong(next()); } public double nextDouble() { return Double.parseDouble(next()); } } }