cs220 icon indicating copy to clipboard operation
cs220 copied to clipboard

[Homework 2] Mastering Common Programming Concepts (1/2) (due: 2022-09-16 23:59:59)

Open zzz845zz opened this issue 2 years ago • 6 comments

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!

zzz845zz avatar Aug 31 '22 08:08 zzz845zz

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 avatar Aug 31 '22 16:08 junsooo

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

minseongg avatar Sep 01 '22 01:09 minseongg

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.

minseongg avatar Sep 01 '22 23:09 minseongg

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.

zzz845zz avatar Sep 02 '22 07:09 zzz845zz

Can we also assume the absence of integer overflow in task chooses?

ironore15 avatar Sep 02 '22 10:09 ironore15

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

minseongg avatar Sep 02 '22 12:09 minseongg

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 avatar Sep 05 '22 06:09 theonlyrealALEX

@theonlyrealALEX To avoid integer overflow error, I recommend you to use Pascal's triangle.

minseongg avatar Sep 05 '22 08:09 minseongg

The previous gg submissions are nullified. Please submit your solution again!

jeehoonkang avatar Sep 08 '22 12:09 jeehoonkang

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.

minseongg avatar Sep 11 '22 21:09 minseongg

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?

intellkim avatar Sep 15 '22 22:09 intellkim

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?

wargij avatar Sep 15 '22 23:09 wargij

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.

inhyeok-jeong avatar Sep 16 '22 00:09 inhyeok-jeong

@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

zzz845zz avatar Sep 16 '22 00:09 zzz845zz

@wargij I also recommend you to check if your code pass the self-grader. (Related issue: https://github.com/kaist-cp/cs220/issues/13)

minseongg avatar Sep 16 '22 00:09 minseongg

@zzz845zz Thank you

intellkim avatar Sep 16 '22 01:09 intellkim

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%

minseongg avatar Oct 13 '22 20:10 minseongg