-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1-9kyo-hwang #1
1-9kyo-hwang #1
Conversation
β¦o 1-GuKyoHwang
AlgoLeadMe 3ν μ€λ°λ
```cpp |
} else { | ||
for(const int i : v) { | ||
if(i <= m) { | ||
result = false; | ||
break; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else μ°μ§ μκ³ , μ λΆλΆμμ 쑰건 λ§μ‘±νλ©΄ returnμ΄λ breakλ‘ λμ΄μ£Όλ 건 μ΄λ¨κΉμ?
μ€μ½νκ° λ무 κΉμ΄μ§λ κ² κ°μμ!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
μκ³ νμ
¨μ΅λλ€!!
vectorλ³μλ μ²μ λ€μ΄λ³΄λ κ°λ
μ΄μλλ° μμΌλ‘λ μ λ°°λ μ½λ ν΅ν΄μ λ§μ΄ λ°°μκ°κ²μ
μκ³ νμ
¨μ΅λλ€!π |
π λ¬Έμ λ§ν¬
[κΈ°λ³Έ] ν볡μ μ±μ μμ΄ μλμμμ.
βοΈ μμλ μκ°
1λΆ
β¨ μλ μ½λ
λ¨Όμ ꡬλ¦μ΄κ° λ£λ μμ κ°μ tλ₯Ό μ λ ₯λ°λλ€.
κ·Έλ¦¬κ³ κ΅¬λ¦μ΄κ° 'A+' 쑰건μ μΆ©μ‘±νλ μ§, μΆ©μ‘±νμ§ λͺ»νλ μ§λ₯Ό λνλ΄λ boolean λ³μ answerλ₯Ό μ μΈ, trueλ‘ μ μνλ€.
μμ κ°μ tλ§νΌ λ°λ³΅νλ©΄μ, κ° κ³Όλͺ© λ³λ‘ A+ κΈ°μ€μ μΆ©μ‘±νλ μ§ κ²μ¬νμ.
μ΄ κ³Όλͺ©μ μκ°ν νμ μ lμλ€κ° A+ λΉμ¨μ λνλ΄λ nμ κ³±νλ©΄, A+μ ν΄λΉνλ νμ μκ° λνλλ€. μ΄ λ n μ체λ %μμΉλ₯Ό λνλ΄λ―λ‘ 100μΌλ‘ λλ 0.?μΌλ‘ νννλ€.
λ€μμΌλ‘ κ° μν νκ° μ μλ₯Ό νμΈνκΈ° μν΄, μν νκ° μ μκ° λ΄κΈ΄ λ°°μ΄ vλ₯Ό μννλ€.
λ°λ³΅λ¬Έμ΄ λͺ¨λ λλ¬λ€λ©΄, λ§μ§λ§μΌλ‘ κ²°κ³Όλ₯Ό μΆλ ₯ν΄μ£Όμ.
μ λ°λ³΅λ¬Έ μνμ΄ λλ¬μμλ resultκ° μ¬μ ν trueλΌλ©΄, ꡬλ¦μ΄λ "λͺ¨λ κ³Όλͺ©μμ A+μ λ°μμ"μ μλ―Ένκ² λλ€. λ°λΌμ true, μ¦ 1μ μΆλ ₯νκ² λλ€.
μλλΌλ©΄ false, μ¦ 0μ μΆλ ₯νκ² λλ€.
μ 체 μ½λλ μλμ κ°λ€.
π μλ‘κ² μκ²λ λ΄μ©