Skip to content

Instantly share code, notes, and snippets.

View CodeMath's full-sized avatar
🎯
Focusing

codemath CodeMath

🎯
Focusing
  • Seoul, Korea
View GitHub Profile

피보나치 배열은 0과 1로 시작하며, 다음 피보나치 수는 바로 앞의 두 피보나치 수의 합이 된다. 정수 N이 주어지면, N보다 작은 모든 짝수 피보나치 수의 합을 구하여라.

예제) Input: N = 12 Output: 10 // 0, 1, 2, 3, 5, 8 중 짝수인 2 + 8 = 10.

@CodeMath
CodeMath / algo.md
Created April 13, 2018 03:31
백준 랜덤 알고리즘 문제_20180413
@CodeMath
CodeMath / algo.md
Created April 12, 2018 03:30
백준 랜덤 알고리즘 문제_20180412
@CodeMath
CodeMath / algo.md
Created April 11, 2018 03:30
백준 랜덤 알고리즘 문제_20180411
@CodeMath
CodeMath / views.py
Created April 10, 2018 10:33
[django 2.0+] is_authenticated() function error : TypeError:
# is_authenticated() function get error
# TypeError: 'bool' object is not callable
def has_add_permission(self, request):
"""Return True if the user has the permission to add a model."""
try:
user_is_authenticated = request.user.is_authenticated()
except TypeError:
user_is_authenticated = request.user.is_authenticated
@CodeMath
CodeMath / algo.md
Created April 10, 2018 03:33
백준 랜덤 알고리즘 문제_20180410
@CodeMath
CodeMath / algo.md
Created April 10, 2018 03:31
백준 랜덤 알고리즘 문제_20180410
@CodeMath
CodeMath / algo.md
Created April 10, 2018 03:30
백준 랜덤 알고리즘 문제_20180410
@CodeMath
CodeMath / algo.md
Last active April 9, 2018 03:31
백준 랜덤 알고리즘 문제_20180409

20180409 알고리즘 문제 문제출처: https://www.acmicpc.net/problem/14195

문제 The new DotA game is coming out soon. All the fans around the world are waiting to try the new version of DotA: ”DotB”.

There’s a lot of pressure on the developers of the game to add new heroes to it. They come up with ideas but not all of them are worth implementing. For one particular hero they are working on, they asked you to write a program to analyze one of its abilities. The hero’s name is ”Cave Man”, and his ability is to summon a crow to attack a line of enemies.

The line has n enemies with hitpoint h1h2...hn. The crow always starts at the first enemy and attacks each one and goes to the next. It attacks exactly n + 5 times in total, and if it reaches the end of the line, it continues the attack from the other end of the line.

@CodeMath
CodeMath / query.graphql
Last active April 3, 2018 13:46
GitHub - user, repo/count, commit history.
query{
user(login: "CodeMath") {
repositories(last: 100) {
totalCount
nodes {
name
defaultBranchRef {
target {
...on Commit {
history(since: "2018-04-03T00:00:00+00:00") {