Releases: ketankr9/cses-cli
Releases · ketankr9/cses-cli
cses-cli
Clean LaTex based
(master)\> cses-cli show 1068
CSES - Weird Algorithm
* Time limit: 1.00 s
* Memory limit: 512 MB
Consider an algorithm that takes as input a positive integer n. If
n is even, the algorithm divides it by two, and if n is odd, the
algorithm multiplies it by three and adds one. The algorithm repeats
this, until n is one. For example, the sequence for n=3 is as
follows:
[ 3 → 10 → 5 → 16 → 8
→ 4 → 2 → 1]
Your task is to simulate the execution of the algorithm for a given
value of n.
Input
The only input line contains an integer n.
Output
Print a line that contains all values of n during the algorithm.
Constraints
* 1 ≤ n ≤ 10^6
Example
Input:
3
Output:
3 10 5 16 8 4 2 1
cses-cli
Standardized the project a bit.
- Move to go module
- Use famous venomous cobra cmd library
- Use viper for reading the config file and integration it with cmd flags.
- Upgrade go version to 1.16
- Add Intellij GoLand run configuration
Note: For macos use darwin build.
cses-cli
cses-cli
- Common cacheSet/Get for all structs using
interface{}
. - persistent list and offline update on correct or wrong solution.
- title in file name. Eg
1742.Robot-Path.cpp
, previously1742.task.cpp
.
cses-cli
Multiple language support: java, cpp, python, javascript
Custom Template: create a file named template.cpp, template.py, template.java, template.js for respective languages in the working directory to use this feature.
cses-cli
GitHub Auto Commit : Now your accepted solution will automatically be committed to your GitHub repository if configured.
cses-cli
cses-cli login
cses-cli list
cses-cli show 1742
cses-cli solve 1742
cses-cli submit 1742.task.cpp
Note: Make sure to rename the required binary to cses-cli
for convenience :)
cses-cli
- first working release
cses-cli login
cses-cli list
cses-cli show 1742
cses-cli solve 1742
cses-cli submit 1742.task.cpp
Note: Make sure to rename the binary to cses-cli
for convenience :)