-
Notifications
You must be signed in to change notification settings - Fork 0
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
7-pu2rile #26
Conversation
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.
if '666' in str(six):
νμ΄μ¬μ μ΄λ κ²ν΄μ strμ νΉμ λ¬Έμκ° μμμ μ°Ύμ μ μκ΅°μ..!
μ λ λ¬Έμμ΄ λΌμ΄λΈλ¬λ¦¬ κΈ°λ₯μ μ¨μ νμλλ° λΌμ΄λΈλ¬λ¦¬ κΈ°λ₯μ μμ°κ³ νΈλ λ°©λ²λμλλΌκ΅¬μ
666κ° μ‘΄μ¬νλ μμΈμ§ νμΈνκΈ° μν΄ λ§μ§λ§ μλ¦Ώμλ₯Ό λ°λ³΅μ μΌλ‘ μ κ±°νλ λ°©λ²μ
λλ€.
μ΄λ² PRλ μκ³ νμ
¨μ΅λλ€π
int main()
{
cin >> N;
ans = 0; // μν μ λͺ©
cnt = 0; // νμ¬ λͺλ²μ¨° μ’
λ§μ μμΈμ§
while (cnt != N)
{
ans++;
temp = ans;
// μμ 6μ΄ μ μ΄λ 3κ°μ΄μ λ€μ΄κ°λμ§ νλ³
while (temp != 0)
{
if (temp % 1000 == 666) // μ’
λ§μ μ«μλΌλ©΄
{
cnt++;
break;
}
else temp /= 10; // μΌμ μ리μ μμ
}
}
cout << ans;
}
`
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.
λ¬Έμ κ° μ΄ν΄κ° λ μ€ μκ³ κ³§μ₯ νμ΄λ΄€λ€κ° λ무 λ¨μνκ² μκ°ν΄μ...λ§νλ€μ... μκ°νκ±°λ λ§μ΄ λ¬λμ΄μ..κ·Έλμ λνλ μ½λ 보면μ μ²μ²ν μ΄ν΄ν΄λ΄€μ΄.. μ²μμ μ λ ₯λ°λ μ«μμ λ°λΌ 666μμ μ«μλ§ κ³μ μ¦κ°λ§ νλ κ±΄μ€ μκ³ λ¬Έμ κ° μ’ μ΄μνλ€κ³ μκ°νκΈ΄ νλλ°..λ°λ³΄κ°μμ΄μπ κ·Έλ₯ 666μμ N-1μ μ«μλ§ λΆμ¬μ£Όλ©΄ λλ μ€ μμλλ°, λνλμ΄ μ£Όμ)λ‘ μ μ΄λ λΆλΆμ²λΌ κ·Έλ° μλ€λ λλ€λ κ±Έ...κ°κ³Όνλ€μ.
666μ΄ λ€μ΄κ° μ λͺ©μ μνλ₯Ό μ°Ύλλ€λκ±Έ μ λλ‘ μ΄ν΄νκ² μ’ λ¦μμ΄μ... 666μ΄ λ€μ΄κ°μ§ μμμΌλ©΄ μνλ μ λͺ©μ΄ μλλκΉ λ μ¦κ°μν€κ³ κ³μν΄μ λ°λ³΅νλ€κ° μΉ΄μ΄νΈ νμκ° nκ³Ό κ°μΌλ©΄ λ°λ‘ μΆλ ₯νλ©΄ λλ ꡬ쑰μκ΅°μ! μκ°λ³΄λ€ μ νν λ λ¬Έμ κ° μ μ΄ν΄νκΈ° νλ€μμ΄μ.. κ·Έλλ κ³μ 보λκΉ μ΄ν΄λ λλκ΅°μ.
νμ€ν νμ΄μ¬μ νΉμ λ¬Έμλ₯Ό μ°Ύλ κ²μ΄ λ§€μ° νΈλ¦¬ν κ² κ°μμ
666μ κ°μ§κ³ μλμ§λ₯Ό if '666' in str(six):
λ§μΌλ‘ κ°λ₯νλκΉμγ
λ°λ‘ μμ보λ μ΄λ κ² κ°μ₯ μμ μ’
λ§μ μ«μμΈ 666λΆν° μμν΄μ λ¨μν μ«μλ₯Ό νλμ© μ¦κ°μμΌλκ°λ©° λ€λ₯Έ μ’
λ§μ μ«μλ₯Ό μ°Ύλ λ°©μμ μκ³ λ¦¬μ¦μ **'λΈλ£¨νΈν¬μ€ μκ³ λ¦¬μ¦'**μ΄λΌκ³ νλ€κ³ ν©λλ€! κ°λ₯ν λͺ¨λ κ²½μ°μ μλ₯Ό λͺ¨λ νμνλ μκ³ λ¦¬μ¦μ΄λ€μ.
PR μκ³ νμ
¨μ΅λλΉπ§
π λ¬Έμ λ§ν¬
https://www.acmicpc.net/problem/1436
βοΈ μμλ μκ°
25λΆ
β¨ μλ μ½λ
six
κ°μ '666'μ΄ ν¬ν¨λλμ§λ₯Ό νλ¨cnt
λ³μλ₯Ό 1μ© μ¦κ°six
κ°μ 1μ© μ¦κ°μμΌcnt
μ μκ° nμ΄ λ λκΉμ§ λ°λ³΅ν λ€cnt == n
μ΄λ©΄ λ°λ³΅λ¬Έ νμΆπ₯οΈ μ½λ
π μλ‘κ² μκ²λ λ΄μ©