結果
| 問題 |
No.1934 Four Fruits
|
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-03-26 15:54:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 2,000 ms |
| コード長 | 605 bytes |
| コンパイル時間 | 507 ms |
| コンパイル使用メモリ | 82,040 KB |
| 実行使用メモリ | 53,492 KB |
| 最終ジャッジ日時 | 2025-03-26 15:54:49 |
| 合計ジャッジ時間 | 1,414 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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