You are not logged in. Please login at www.codechef.com to post your questions!

×

what are sub tasks?how to accomplish them?

0
2

many problems on codechef have constraints,and sub tasks. what are they? and how they should be dealt with? i mean if the provide the range,then m i supposed to use if condition for range of input?

asked 12 Oct '14, 00:23

ansh1star033's gravatar image

3★ansh1star033
20629
accept rate: 9%


Hi @ansh1star033! Constraints are just given to provide you an idea as of how long or exactly what data type should you use. Most of the times here int won't work because according to constraints, some variables might take a value exceeding the range of int, so you use long or long long there. e.g. Given constraints on a variable n: n<=1000000000, so you declare n as:

long long n;

If you don't do this, for test cases with input value higher than range of integers, your program might throw some garbage value.

Sub task means different levels of input on which you will be judged. It means that unlike other questions where you need to pass all the test cases to get an AC, here even if you pass one sub task you will get AC but not full marks. Distribution of marks may differ from task to task.

link

answered 12 Oct '14, 00:33

xiaoyu_02's gravatar image

2★xiaoyu_02
5531922
accept rate: 5%

So,sub tasks just tells about the marks distribution,it has got nothing to do with the code,i mean write different code for different subtasks,or manage it somehow. Are these given so that we get to know the judging criteria of that problem only?

(15 Oct '14, 00:20) ansh1star0333★

hi, what does this mean??

Constraints

1 ≤ T ≤ 10

1 ≤ N ≤ 105

Si = {'R','G','B'} Scoring

Subtask 1 (40 points) : 1 ≤ N ≤ 10 Subtask 2 (60 points) : original constraints

link

answered 14 Jun '16, 00:21

noobfh's gravatar image

2★noobfh
1
accept rate: 0%

@noobfh : The constraints will tell you the minimum and maximum value of variables used in input. In the case described above, T will not exceed 10 in any test case and N will not exceed 10^5 in any test case and Si will be any of R,G or B.

Now for the subtask 1, it is given that all the test cases will contain value of N not exceeding 10. and in subtask 2, N will be same as of original constrains i.e. not exceeding 10^5. So, based on the constraints you can estimate the running time of your program by calculating its time complexity and you can know the data type to be used for the variables.

@ansh1star033: You don't have to write different codes for different sub tasks, just make sure that you have taken data type which wont overflow with given constraints. Subtasks do tell marks distribution and they are useful as you will get partial score if any subtask passed which better than getting no score.

link

answered 14 Jun '16, 04:07

rishab951's gravatar image

4★rishab951
2
accept rate: 0%

terimakasih atas informasinya gan sukses selalu informasinya sangat sangat bagus Obat Kram Perut Tradisional

link

answered 14 Jun '16, 09:24

dianwilda8's gravatar image

0★dianwilda8
1
accept rate: 0%

In essence, you need to accomplish all sub-tasks to get full marks. But even if you don't accomplish all sub-tasks, you won't get a WA if you have accomplished at least one sub-task.

link

answered 08 Apr '17, 14:41

mr_nair's gravatar image

1★mr_nair
21
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×30

question asked: 12 Oct '14, 00:23

question was seen: 9,178 times

last updated: 08 Apr '17, 14:41