結果
| 問題 | No.349 干支の置き物 |
| コンテスト | |
| ユーザー |
nohakai3
|
| 提出日時 | 2022-08-07 20:11:19 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 2,000 ms |
| コード長 | 339 bytes |
| 記録 | |
| コンパイル時間 | 502 ms |
| コンパイル使用メモリ | 20,544 KB |
| 実行使用メモリ | 15,360 KB |
| 最終ジャッジ日時 | 2026-04-06 07:04:40 |
| 合計ジャッジ時間 | 4,699 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 29 |
ソースコード
n=int(input())
l=[]
from collections import Counter
for i in range(n):
s=input()
l.append(s)
c=Counter(l)
l2=list(set(l))
p=0
for x in l2:
p=max(p,c[x])
a=n//2
if n%2==0:
if a>=p:
print("YES")
else:
print("NO")
elif n%2==1:
if a+1>=p or a>=p:
print("YES")
else:
print("NO")
nohakai3