Git Product home page Git Product logo

algorithm-candies's Introduction

#algorithm-candies

사탕을 성적 따라 나눠 주는 문제

rule

1열로 아이들이 n 명 존재한다.

아이들마다 1 <= 100 까지의 시험 성적을 갖고 있다.

모든 아이들에게 1개 이상의 사탕을 나눠줘야 한다.

성적이 좋은 아이는 좌/우에 앉은 아이보다 더 많은 사탕을 받아야 한다.

예제

  • 조건

      3명의 아이 
      점수 1, 2, 2
    
  • 결과

      4
    
  • 사탕의 개수

      1개 2개 1개 
    

예제 2

  • 조건

      10명의 아이 
      점수 2, 4, 2, 6, 1, 7, 8, 9, 2, 1
    
  • 결과

      19
    
  • 사탕의 개수

      1개 2개 1개 2개 1개 2개 3개 4개 2개 1개 
    

예제 3

  • 조건

      4명의 아이
      점수 3,2,1,4
    
  • 결과

      8
    
  • 사탕의 개수

      3개 2개 1개 2개 
    

algorithm-candies's People

Contributors

babosamo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.