結果
| 問題 |
No.349 干支の置き物
|
| コンテスト | |
| ユーザー |
kohaku_kohaku
|
| 提出日時 | 2016-11-13 21:31:06 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 827 bytes |
| コンパイル時間 | 1,979 ms |
| コンパイル使用メモリ | 75,192 KB |
| 実行使用メモリ | 54,152 KB |
| 最終ジャッジ日時 | 2024-11-25 21:58:03 |
| 合計ジャッジ時間 | 6,677 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 24 WA * 5 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
int h = (N+1)/2;
String [] E = {"ne","ushi","tora","u","tatsu","mi","uma","hitsuji","saru","tori","inu","i"};
String [] A = new String [N];
int [] B = new int [12];
int max = 0;
for(int i=0; i<N; i++){
//A[i] = sc.next();
for(int j=0; j<12; j++){
if( E[j].equals(A[i]) ){
B[j]++;
max = Math.max(max, B[j]);
break;
}
if(max>=h){
System.out.println("NO");
return;
}
}
}
System.out.println("YES");
}
}
kohaku_kohaku