Giter Site home page Giter Site logo

20201105-homework-basic's Introduction

本週作業:分組 array 版(grouping-array.cpp)

試著使用 array 來完成上次 TOI 練習賽的「分組」。 重點摘要:

  • 分組時一樣依序列 由右往左 分組。
  • 戰力指數改為介於 int 正整數範圍。
  • 保證序列最左邊選手的戰力指數不是 0。

輸入說明

每次輸入兩行資料。 第一行輸入含有兩個數字 C (1 ≤ C ≤ 100) 和 N (1 ≤ N ≤ 8),分別代表幾個參賽者,以及一組有幾人。 第二行則是輸入一串數字 P,以空白間隔共 C 個數字(P1 到 PC),為參賽者依分組序列將個別戰力指數組成的數字。

輸出說明

與原題目相同。

範例

輸入範例 輸出範例
範例 1 3 1
3 6 9
1 9
範例 2 6 2
1 9 3 4 2 6
3 10
範例 3 8 5
1 0 1 2 1 3 1 5
1 12
範例 4 8 4
1 2 3 4 4 3 2 1
2 10
範例 5 3 1
831 911 5566
1 5566

Pull Request 前請確認以下事項:

  • 已閱讀 作業繳交方式
  • 在下方附上 Repl 連結
  • 檔案放在自己學號的目錄下
  • 標題以「班級座號、學號、姓名」作為開頭
  • 其他說明事項可以在下面補充

20201105-homework-basic's People

Contributors

goodjack 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.