結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
fal_rnd
|
| 提出日時 | 2016-10-28 16:39:34 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 766 bytes |
| コンパイル時間 | 2,449 ms |
| コンパイル使用メモリ | 77,952 KB |
| 実行使用メモリ | 54,328 KB |
| 最終ジャッジ日時 | 2024-11-24 05:11:55 |
| 合計ジャッジ時間 | 7,268 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 WA * 2 |
ソースコード
import java.util.*;
class A {
static Scanner s = new Scanner(System.in);
static enum ETO{
ne,
ushi,
tora,
u,
tatsu,
mi,
uma,
hitsuji,
saru,
tori,
inu,
i,
;
int amount=0;
static ETO match(String s) {
boolean b = false;
for(ETO eto:ETO.values()) {
if(s.matches(eto.name())) {
eto.amount++;
return eto;
}
}
return null;
}
@Override
public String toString() {
return this.name()+":"+this.amount;
}
}
public static void main(String[] args) {
int in = s.nextInt();
while(s.hasNext()) {
ETO.match(s.next());
}
int max = 0;
for(ETO e:ETO.values()) {
max = Math.max(max, e.amount);
}
if(max>in/2+1) {
System.out.println("NO");
}else {
System.out.println("YES");
}
}
}
fal_rnd