-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# 9375λ²: ν¨μ μ μ ν΄λΉ - <img src="https://static.solved.ac/tier_small/8.svg" style="height:20px" /> Silver III | ||
|
||
<!-- performance --> | ||
|
||
<!-- λ¬Έμ μ μΆ ν κΉνλΈμ νΈμλ₯Ό νμ λ μ μΆν μ½λμ μ±λ₯μ΄ μ λ ₯λ 곡κ°μ λλ€.--> | ||
|
||
<!-- end --> | ||
|
||
## λ¬Έμ | ||
|
||
[λ¬Έμ λ§ν¬](https://boj.kr/9375) | ||
|
||
|
||
<p>ν΄λΉμ΄λ ν¨μ μ λ§€μ° λ―Όκ°ν΄μ νλ² μ μλ μ·λ€μ μ‘°ν©μ μ λ λ€μ μ μ§ μλλ€. μλ₯Ό λ€μ΄ μ€λ ν΄λΉμ΄κ° μκ²½, μ½νΈ, μμ, μ λ°μ μ μλ€λ©΄, λ€μλ μ λ°μ§λ₯Ό μΆκ°λ‘ μ κ±°λ μκ²½λμ λ μ¦λ₯Ό μ°©μ©νκ±°λ ν΄μΌνλ€. ν΄λΉμ΄κ° κ°μ§ μμλ€μ΄ μ£Όμ΄μ‘μλ κ³Όμ° ν΄λΉμ΄λ μλͺΈμ΄ μλ μνλ‘ λ©°μΉ λμ λ°μ λμλ€λ μ μμκΉ?</p> | ||
|
||
|
||
|
||
## μ λ ₯ | ||
|
||
|
||
<p>첫째 μ€μ ν μ€νΈ μΌμ΄μ€κ° μ£Όμ΄μ§λ€. ν μ€νΈ μΌμ΄μ€λ μ΅λ 100μ΄λ€.</p> | ||
|
||
<ul> | ||
<li>κ° ν μ€νΈ μΌμ΄μ€μ 첫째 μ€μλ ν΄λΉμ΄κ° κ°μ§ μμμ μ n(0 β€ n β€ 30)μ΄ μ£Όμ΄μ§λ€.</li> | ||
<li>λ€μ nκ°μλ ν΄λΉμ΄κ° κ°μ§ μμμ μ΄λ¦κ³Ό μμμ μ’ λ₯κ° κ³΅λ°±μΌλ‘ ꡬλΆλμ΄ μ£Όμ΄μ§λ€. κ°μ μ’ λ₯μ μμμ νλλ§ μ μ μ μλ€.</li> | ||
</ul> | ||
|
||
<p>λͺ¨λ λ¬Έμμ΄μ 1μ΄μ 20μ΄νμ μνλ²³ μλ¬Έμλ‘ μ΄λ£¨μ΄μ ΈμμΌλ©° κ°μ μ΄λ¦μ κ°μ§ μμμ μ‘΄μ¬νμ§ μλλ€.</p> | ||
|
||
|
||
|
||
## μΆλ ₯ | ||
|
||
|
||
<p>κ° ν μ€νΈ μΌμ΄μ€μ λν΄ ν΄λΉμ΄κ° μλͺΈμ΄ μλ μνλ‘ μμμ μ μ μ μλ κ²½μ°λ₯Ό μΆλ ₯νμμ€.</p> | ||
|
||
|
||
|
||
## μμ€μ½λ | ||
|
||
[μμ€μ½λ 보기](ν¨μ μ%20μ ν΄λΉ.cpp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: ::: ::: */ | ||
/* Problem Number: 9375 :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: fkdl4878 <boj.kr/u/fkdl4878> +#+ +#+ +#+ */ | ||
/* +#+ +#+ +#+ */ | ||
/* https://boj.kr/9375 #+# #+# #+# */ | ||
/* Solved: 2024/05/19 15:33:17 by fkdl4878 ### ### ##.kr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
#include <bits/stdc++.h> | ||
using namespace std; | ||
|
||
int main(){ | ||
int tcase; | ||
string a, b; | ||
int ret; | ||
|
||
cin >> tcase; | ||
while (tcase--) | ||
{ | ||
map<string, int> m; | ||
int n; | ||
cin >> n; | ||
for (int i = 0; i < n; i++){ | ||
cin >> a >> b; | ||
m[b]++; | ||
} | ||
|
||
ret = 1; | ||
for(auto it : m){ | ||
ret *= it.second + 1; | ||
} | ||
|
||
cout << ret - 1 << '\n'; | ||
} | ||
} |
Binary file not shown.