cs220
cs220 copied to clipboard
[Homework 2] Mastering Common Programming Concepts (1/2) (due: 2022-09-16 23:59:59)
Re-learn the common programming concepts in Rust.
-
Read the description here. You're going to fill out the
todo!()
s. -
You can grade your solution yourself by running
./script/grade-02.sh
. -
Submit your code here.
-
IMPORTANT: only the last submission counts. Please make sure the last submission succeeds.
-
IMPORTANT: don't fork this repository. It'll be public!
Suggestion: How about adding test case up3(1)
for test_up3
, and chooses(1)
(or chooses(0)
..) for test_chooses
to properly check some corner cases?
@junsooo Thanks for suggestion!
IMPORTANT: We added more test cases (https://github.com/kaist-cp/cs220/commit/c2df180b2e7ba90fdfc5601e7b06b9a1efe8f428) and nullified all previous submissions. Please check it and submit again.
IMPORTANT: We added test cases of gcd
and sum_array
(https://github.com/kaist-cp/cs220/commit/45225857e964e7ada1ce37110db28ff09d0c7a19) and nullified all previous submissions.
Please check it and submit again. Sorry for the inconvenience.
As #16 suggested, we decided to accept pull requests until 9/08 for adding extra test cases. So please feel free to make a PR if you think we need more test cases.
IMPORTANT: We will nullify all previous submissions on 09/08. Please keep this in mind and submit your solution again after 09/08. Sorry for the inconvenience.
Can we also assume the absence of integer overflow in task chooses
?
@ironore15 Yes, you can assume the absence of integer overflow in task chooses
and fibonacci
.
We updated description in https://github.com/kaist-cp/cs220/commit/26bc95d05726cd49e2d48f3308b96a7a75950e5d. Thank you for reporting.
The test case with the huge numbers for chooses
produces integer overflows for me and other related errors.
How should I deal with that?
@minseongg
edit: feel free to check my code in the server for reference
@theonlyrealALEX To avoid integer overflow error, I recommend you to use Pascal's triangle.
The previous gg submissions are nullified. Please submit your solution again!
We updated the skeleton code of assignments. Please do git pull
before submitting your solution. (https://github.com/kaist-cp/cs220/commit/04cfaf7b77c43273ea5bb2f2dab69931a9930f30)
Since this update does not affect the score, we will not nullify the previous submissions.
I write the code about choose problem by using recursive function that adding 2 numbers above the number in Pascal's triangle. But the running time become too long when the number increases. What can I do to solve this problem?
I passed all the test with vscode, but the submission in gg is always failed(No). I already updated the assignment and grader file. How can I solve this problem?
I passed all the test with vscode, but the submission in gg is always failed(No). I already updated the assignment and grader file. How can I solve this problem?
I recommend you to check log in submisson page. I had same issues and I had to fix my code to satisfy requirement for compiler in gg. There can be some error in your code since we set deny[] in our repo but gg doesn't have such deny[] options.
@intellkim You can reduce the time by reusing the result, not computing the same target every time. Here is a good reference: https://en.wikipedia.org/wiki/Dynamic_programming#Fibonacci_sequence
@wargij I also recommend you to check if your code pass the self-grader. (Related issue: https://github.com/kaist-cp/cs220/issues/13)
@zzz845zz Thank you
The accepted rate for the homework 2 is as follows. (Except for the students who dropped the course)
- Total: 133
- Success: 129
- Success rate: 96.99%