結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
Tsukasa_Type
|
| 提出日時 | 2018-03-01 00:03:09 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 559 bytes |
| コンパイル時間 | 2,616 ms |
| コンパイル使用メモリ | 76,584 KB |
| 実行使用メモリ | 41,580 KB |
| 最終ジャッジ日時 | 2024-12-23 02:22:00 |
| 合計ジャッジ時間 | 8,396 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 7 |
ソースコード
import java.util.*;
import static java.lang.System.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void main(String[] args) {
int n = sc.nextInt();
Map<String,Integer> map = new LinkedHashMap<>();
String s;
for (int i=0; i<n; i++) {
s = sc.next();
map.put(s,map.getOrDefault(s,0));
map.put(s,map.get(s)+1);
}
int max = -1;
for (Map.Entry<String,Integer> entry : map.entrySet()) {
max = Math.max(max,entry.getValue());
}
if (max < (n+1)/2) {out.println("YES");}
else {out.println("NO");}
}
}
Tsukasa_Type