結果
| 問題 | No.1934 Four Fruits |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-26 15:54:08 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 57 ms / 2,000 ms |
| コード長 | 605 bytes |
| 記録 | |
| コンパイル時間 | 233 ms |
| コンパイル使用メモリ | 95,856 KB |
| 実行使用メモリ | 79,040 KB |
| 最終ジャッジ日時 | 2026-07-07 22:27:51 |
| 合計ジャッジ時間 | 2,050 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 7 |
ソースコード
a, b, c = map(int, input().split())
for x in range(4):
temp = [a, b, c, x]
counts = [0] * 4
for num in temp:
counts[num] += 1
# Check condition 1: all same
cond1 = any(cnt == 4 for cnt in counts)
# Check condition 2: exactly two types each appearing twice
freq = {}
for cnt in counts:
if cnt > 0:
freq[cnt] = freq.get(cnt, 0) + 1
cond2 = freq == {2: 2}
# Check condition 3: all distinct
cond3 = all(cnt <= 1 for cnt in counts) and (sum(counts) == 4)
if cond1 or cond2 or cond3:
print(x)
break
lam6er