621 - Secret Research

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

Moderator: Board moderators

User avatar
Ming Han
Learning poster
Posts: 77
Joined: Thu Jun 06, 2002 7:10 pm
Location: Singapore
Contact:

621 - Secret Research

Post by Ming Han » Sat Jun 15, 2002 5:06 pm

What does
In case the analysed string does not determine the experiment result, a first match from the above list should be outputted.
mean?

Thank You

cyfra
Experienced poster
Posts: 144
Joined: Thu Nov 22, 2001 2:00 am
Location: Gdynia, Poland

Hi!

Post by cyfra » Mon Jun 24, 2002 5:15 pm

Hi!

It means that for this input :
19035
You should output:
-
because the negative result is before not completed experiment...

And that's all...

Good Luck :wink:

User avatar
Ming Han
Learning poster
Posts: 77
Joined: Thu Jun 06, 2002 7:10 pm
Location: Singapore
Contact:

ACM 621

Post by Ming Han » Tue Jun 25, 2002 8:59 am

What if you have something like "12345".

Thank You

cyfra
Experienced poster
Posts: 144
Joined: Thu Nov 22, 2001 2:00 am
Location: Gdynia, Poland

Post by cyfra » Tue Jun 25, 2002 12:09 pm

Hi!

My program returs '-' but I think that there shouldn't be such a case in the input, because it describes nothing....

and what your program gives ??

Larry
Guru
Posts: 647
Joined: Wed Jun 26, 2002 10:12 pm
Location: Hong Kong and New York City
Contact:

Post by Larry » Fri Jun 28, 2002 12:15 pm

So what do we do in the default case?

cyfra
Experienced poster
Posts: 144
Joined: Thu Nov 22, 2001 2:00 am
Location: Gdynia, Poland

Post by cyfra » Fri Jun 28, 2002 12:27 pm

Larry wrote:So what do we do in the default case?
What do you mean ??

In the input which is given in task description everything is OK...

Fresh
New poster
Posts: 46
Joined: Mon Apr 15, 2002 10:42 am
Contact:

Help

Post by Fresh » Fri Aug 23, 2002 5:18 pm

Hi,

U're right for the '+' sign but nop the others. Read the question carefully.

[cpp]
'-' for a[strlen(a) - 2] = "35"
'*' for a[0] = '9' and a[strlen(a) - 1] = '4'
'?' for a[0-2] = "190"
[/cpp]

-novice :roll:

dwyak
New poster
Posts: 36
Joined: Sun Jul 28, 2002 5:16 am
Location: P.R.China
Contact:

621 PE

Post by dwyak » Fri Sep 06, 2002 10:18 am

The problem is simple, but I cannot get AC.
I've tested. There's no illegal case in input.
Are there any tricks?

And there's my program.

[cpp]#include <fstream.h>
#include <string.h>

//ifstream fin("621.txt");
#define fin cin
#define endl '\n'

char str[1000000];

main() {
int cases, pcase;
fin >> cases;
for (pcase = 0; pcase < cases; pcase++) {
fin >> str;
if (strcmp(str, "1") == 0 || strcmp(str, "4") == 0 || strcmp(str, "78") == 0) {
cout << "+" << endl;
continue;
}
int l = strlen(str);
if (l >= 2 && str[l - 1] == '5' && str[l - 2] == '3') {
cout << "-" << endl;
continue;
}
if (str[0] == '9' && str[l - 1] == '4') {
cout << "*" << endl;
continue;
}
if (l >= 3 && str[0] == '1' && str[1] == '9' && str[2] == '0') {
cout << "?" << endl;
continue;
}
cout << endl;
}

return 0;
}[/cpp]
Wenyuan Dai, Shanghai Jiaotong University.

User avatar
cytse
Learning poster
Posts: 67
Joined: Mon Sep 16, 2002 2:47 pm
Location: Hong Kong
Contact:

Post by cytse » Fri Oct 11, 2002 6:05 pm

To get AC, there should be no EOLN after the last line of output... but I don't think it is right

kurnia w
New poster
Posts: 18
Joined: Fri Dec 06, 2002 3:53 pm
Location: Indonesia
Contact:

621 what's wrong with this code ??

Post by kurnia w » Fri Dec 06, 2002 4:15 pm

Never mind...
Last edited by kurnia w on Sat May 17, 2003 12:15 pm, edited 1 time in total.

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski » Fri Dec 06, 2002 4:56 pm

there was a thread about this problem.
look at this ....

Regards
Dominik

Master
Learning poster
Posts: 82
Joined: Thu Oct 10, 2002 1:15 pm
Location: St. Johns, Canada
Contact:

621- what is the reasult?

Post by Master » Tue Jun 03, 2003 3:32 pm

what should be the output of the following input:

190135 :roll:

please anyone tell me the reasult?
M H

Dominik Michniewski
Guru
Posts: 834
Joined: Wed May 29, 2002 4:11 pm
Location: Wroclaw, Poland
Contact:

Post by Dominik Michniewski » Tue Jun 03, 2003 3:53 pm

I think "-"

Best regards
DM
If you really want to get Accepted, try to think about possible, and after that - about impossible ... and you'll get, what you want ....
Born from ashes - restarting counter of problems (800+ solved problems)

Master
Learning poster
Posts: 82
Joined: Thu Oct 10, 2002 1:15 pm
Location: St. Johns, Canada
Contact:

Post by Master » Thu Jun 05, 2003 8:34 pm

Thanks for help.

I made so :o but why :roll: is there any think is in the qustion????????

thanks
M H

ACoimbra
New poster
Posts: 14
Joined: Thu Apr 10, 2003 1:59 pm
Location: Coimbra, Portugal
Contact:

well

Post by ACoimbra » Fri Jul 11, 2003 4:06 pm

Well I think so, it's very stupid!!!!

Post Reply

Return to “Volume 6 (600-699)”