502 - DEL command

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

Moderator: Board moderators

Caesum
Experienced poster
Posts: 225
Joined: Fri May 03, 2002 12:14 am
Location: UK
Contact:

Post by Caesum » Wed Jul 10, 2002 11:29 pm

thnx xenon, inspiration...... did it :)

somov
New poster
Posts: 2
Joined: Mon Jul 08, 2002 9:35 pm
Contact:

Post by somov » Wed Jul 24, 2002 10:46 am

One more test :
-AAA.EXE
-AAB.EXE
+AA.EXE
Correct answer :
DEL AA?.EXE

MV
New poster
Posts: 4
Joined: Thu Oct 31, 2002 11:30 am

Multiple input

Post by MV » Thu Oct 31, 2002 11:43 am

Although not mentioned in the problem description, the problem input is in the multiple input format as indicated by the green submit icon in the contents list.
If your program knows this and still gets WA, your problem is somewhere else.

epsilon0
Experienced poster
Posts: 112
Joined: Tue Nov 12, 2002 11:15 pm
Location: Paris, France.

Post by epsilon0 » Mon Dec 30, 2002 8:49 am

this problem is easy, i'm surprised it only has 4-5% of AC.

as Picard put it, all you have to do is cook the tightest rule to describe the set of files to delete, then check wether this rule (wildcard) is incompatible with all files to keep.

there are 3 kind of rules:

1- the name of all files to be deleted have the same length.
2- the name of all files to be deleted have length greater than MIN
3- the name of all files to be deleted have character X in position P

1- is stronger than 2- (thus should be preferred)

this applies to both the name and extension of course.

either rule 1 or rule 2 should be considered each time.

rule 1 results in a wildcard of the form: *******
and rule 2: *****?

then rule 3 is used to replace the *'s by letters (or numbers)

i'm pretty sure you can't get a stronger specification of the files.

the checking part is straightforward. just note that in case NO file is to be kept, a good DEL *.* will do the trick :)
We never perform a computation ourselves, we just hitch a ride on the great Computation that is going on already. --Tomasso Toffoli

ansiemens
New poster
Posts: 6
Joined: Tue Aug 09, 2005 11:24 am
Location: New York, NY

Re: 502 - DEL COMMAND

Post by ansiemens » Sun Sep 19, 2010 8:14 pm

following is my WA code, I have tried the input mention above and gotten correct answer.
But it can not pass.
I just can not figure out where is the error part.
Any tricky input or any flaws this code?
thks

Code: Select all

 delete after AC
 any one need my code for more thinking or any discussion, welcome to PM me.
Last edited by ansiemens on Sun Sep 19, 2010 9:56 pm, edited 2 times in total.

ansiemens
New poster
Posts: 6
Joined: Tue Aug 09, 2005 11:24 am
Location: New York, NY

Re: 502 - DEL COMMAND

Post by ansiemens » Sun Sep 19, 2010 9:46 pm

Sorry, I have found the error.
The input size of each line would be at most [+-]+8 chars+'.'+3+'\0' => 14, and I used only ten char to handle.
ansiemens wrote:following is my WA code, I have tried the input mention above and gotten correct answer.
But it can not pass.
I just can not figure out where is the error part.
Any tricky input or any flaws this code?
thks

metaphysis
Experienced poster
Posts: 139
Joined: Wed May 18, 2011 3:04 pm

Re: 502 - DEL command

Post by metaphysis » Sun Apr 16, 2017 2:20 pm

Code: Select all

-AAAAAAA.223
-AAAAAAA.22
-AAAAAAA.227
-AAAAAAA.233
+AAAAAAA.2

Code: Select all

DEL·AAAAAAA.2?*

Post Reply

Return to “Volume 5 (500-599)”