11303 - Permutations

All about problems in Volume 113. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

11303 - Permutations

Post by sclo »

I keep getting WA for this problem too, is the judge even correct?
I used big integer arithmetic in a dp solution.

What's the correct output for this case:
Input:

Code: Select all

250 10 12345678901234567890123456789012345678901234567890
11 33 55 77 99 111 133 155 177 199
My output:

Code: Select all

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 225 215 220 231 227 219 211 232 210 216 246 249 248 212 245 223 250 238 228 229 236 224 237 239 243 222 233 234 247 244 218 214 230 235 217 240 241 226 242 221 213
I noticed that no one else has solved this problem and no one else got AC even on the contest.
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Post by baodog »

Rodrigo sent in a corrected output file for this problem to Miguel Jr. on Sunday, but for some reason, it hasn't been updated yet (maybe they are busy with the new server). Hopefully they will get to it soon, and also rejudge the contest. I have also sent another email reminder to the UVA team.
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Post by baodog »

Check the new stats. The problem has been rejudged.
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Post by baodog »

The contest has also been rejudged.
See the new rankings.
baodog
Experienced poster
Posts: 202
Joined: Wed Jul 04, 2007 6:53 am

Post by baodog »

btw, sorry about all the errors in this contest and any frustration
you may have experienced, and thanks
for all the feedback and corrections.
We did name it "The Relaxation Contest" :-)
... which means it's a for fun only contest that may have unforseen errors.
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

Thanks for a nice problem set anyway. I know that mistakes do happen, even on ACM regionals (as I have experienced it last year).

By the way, it seems that I started most of the threads on the message board for this contest problem set.
Donotalo
Learning poster
Posts: 56
Joined: Sat Aug 20, 2005 11:05 am
Location: Bangladesh

Post by Donotalo »

Can anyone tell me in details how to solve this problem? Thanks in advance.
Image
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

Donotalo wrote:Can anyone tell me in details how to solve this problem? Thanks in advance.
DP

First figure how to solve it for small cases, then implement BigInt and solve the real thing.

Try to think of a dp, I can give more hints if you want.
Donotalo
Learning poster
Posts: 56
Joined: Sat Aug 20, 2005 11:05 am
Location: Bangladesh

Post by Donotalo »

DP! Oh! This is the only thing I always stuck at. DP problems are interesting. That is why I start thinking about the solution and stuck. Actually, I'm a novice in DP programming. Can you please give me some more hints so that I can come up with a recursion?
Image
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

First, do you know how to solve a related problem?
Given n and k, generate the kth lexicographic smallest permutation of 1,2,3,...,n

If not, first solve that problem.
Donotalo
Learning poster
Posts: 56
Joined: Sat Aug 20, 2005 11:05 am
Location: Bangladesh

Post by Donotalo »

Actually I don't. :oops: OK. I think this problem is too difficult for me to try.
Image
sclo
Guru
Posts: 519
Joined: Mon Jan 23, 2006 10:45 pm
Location: Vancouver, BC, Canada
Contact:

Post by sclo »

Donotalo wrote:Actually I don't. :oops: OK. I think this problem is too difficult for me to try.
Yep, maybe you should be solving easier problems :)

I would classify this problem as medium/hard problem in terms of difficulty.
Post Reply

Return to “Volume 113 (11300-11399)”