502 - DEL command
Moderator: Board moderators
-
- New poster
- Posts: 6
- Joined: Wed Jan 16, 2002 2:00 am
- Location: Ukraine
- Contact:
502 - DEL command
How to solve it without very huge full search?
well, i'm not sure if very huge full search. but i applied the following idea: try to get the answer from the input, rather than trying the answer to match the input. ie. get a pattern from the deleted files, i get the 'tightest' possible rule, then i apply this rule to the files to be kept, if it would delete some kept files, that means there's no answer. coz the 'tightest' rule should differentiate the files best already. you cannot find a better way to differentiate the two sets of files.
Can anyone supply some more samples for this ? With the following input:
My program gives the following output:7
-BP.EXE
-BPC.EXE
+TURBO.EXE
-BP.EXE
-BPC.EXE
+TURBO.EXE
-blah.exe
-clay.exe
+bedh.exe
-p.
+BP.EXE
+BPC.EXE
-TURBO.EXE
-BP.EXE
-BPC.EXE
-TURBO.EXE
-BP.EXE
-BPC.EXE
-TURBO.EXE
-TURBO.EXP
which looks reasonable.......DEL BP*.EXE
DEL BP*.EXE
DEL ?la?.exe
DEL p.
DEL TURBO.EXE
DEL ??*.EXE
DEL ??*.EX?
Did you consider:
I'm solving the problem this moment, but I just realised this is valid input.
Code: Select all
-BP.EXE
-BPC.EXE
-BPTEXT
+TURBO.EXE
Maybe the wildcard should be as general as possible (although that is not stated in the problem description). So for
the command should be DEL ?P*.*, as in the example, and not DEL BP*.EXE, as both our programs produce.
If that's the case, I think the discription really is wrong and should be restated.
I'm not going to adjust my program to do this (this would mean rewriting it, I fear), unless it's certain that this causes the WAs.
Happy hunting,
-xenon
Code: Select all
-BP.EXE
-BPC.EXE
+TURBO.EXE
If that's the case, I think the discription really is wrong and should be restated.
I'm not going to adjust my program to do this (this would mean rewriting it, I fear), unless it's certain that this causes the WAs.
Happy hunting,
-xenon
Picard: so your program produces DEL BP*.EXE and gets accepted. Well, that's a great relief.
Could you please confirm that the program gives DEL AB?. in both cases:
And not DEL AB? in either the first or the second case? It would be a great relief too. ![:lol:](./images/smilies/icon_lol.gif)
Could you please confirm that the program gives DEL AB?. in both cases:
Code: Select all
2
-ABC
-ABD
+ACC
+ACD
-ABC.
-ABD.
+ACC.
+ACD.
![:lol:](./images/smilies/icon_lol.gif)
Finally AC!
I just got accepted!
It was my keepfile-checker that was erronious.
The program gave incorrect answers on all of the following cases:
Once I fixed them all, sweet AC was there. Steam must be coming from the Judge's ears (and mine
).
The answers are obvious, so I don't give them
Happy hunting,
-xenon
It was my keepfile-checker that was erronious.
The program gave incorrect answers on all of the following cases:
Code: Select all
8
-A
-AA
-AAA
+AAAA
-AB
-AA
+AAAA
-AB
-BB
+ABAA
-X.A
-X.AA
+X.AAA
-X.AB
-X.AA
+X.AAA
-X.AB
-X.BB
+X.ABA
-X.A
-X.AA
+X
-X.AA
-X.AAA
+X.A
![:wink:](./images/smilies/icon_wink.gif)
The answers are obvious, so I don't give them
![:lol:](./images/smilies/icon_lol.gif)
Happy hunting,
-xenon