### ssavi's blog

By ssavi, 8 years ago,

Hello People !!!

I am trying to solve the following problem . But every time I am getting Wrong Answer ( 100 % ).

I have tried some random Input Output cases compared to the following Accepted Solution ( This is not my solution ). Those cases I have tried all are given the same output as the following code given .

AC Solution: http://ideone.com/RoiU3k

But don't know why I am getting Wrong Answer every time.

Algorithm: Trie

At first I am taking the strings into a Map and Check whether a string comes more then once. If it is then I print Conjunto Ruim . If it is not then,

I tried to find whether there is a prefix of the string I am currently checking is available in any other string except itself using Trie. If it is the I print Conjunto Ruim else I print Conjunto Bom .

Please someone help me why I am getting Wrong Answer? It would be a great favor . I stucked for hours.

• 0

By ssavi, history, 8 years ago,

UPD: SOLVED

Hello .

I am trying to solve this Problem from today morning . I got WA for several times. I am trying to solve it using 0-1 Knapsack Technique .

In this problem I need to print the items those I have entered into the Sack. But I have no idea how to do it. To solve this problem I wrote a function named path_print to print the Items. I know the error is in that function . That's why I am getting Wrong Answer .

It'll be a great favor .

• 0

By ssavi, history, 8 years ago,

Hello All.

Please watch this Data Structure :

order_of_key


Today I found this STL from this solution ( 15th Line from the Last Line ) : http://codeforces.com/contest/658/submission/16995396
of Problem B [ VK CUP DIV2 ] .

But I am failed to understand the actual Purpose & the vast application of this STL . Undoubtedly its a Great Blog & Technique . And with due respect I Thank him .

# Now here is My Queries :

What STLs are used ? Why they are used ? How they should be used ? In which Problems I can use this DS ? Are there any special requirments to implement those ?

Thanks in Advance . It would be great help .

• -12

By ssavi, history, 8 years ago,

HI Great Helpers of CF!!!

This is Ternary Search Problem . I got the Sample Test Correct . But I am failed to find out the Error . May be It could be a Error of my TS process .

Here is My Code : http://pastebin.ubuntu.com/15525055/

I got my Ternary Search Idea from this Blog : http://codeforces.com/blog/entry/11497

And I modified a little to get the answers for Floating point Values . It would be a great Help if someone help me out .

• 0

By ssavi, history, 8 years ago,

Hi Experts .

With due respect I would like to Get some help From you about solving Below's interesting problem .

I confess that I did not try this type of problem before . I know the problem can be solved by Combination & DP or Similar other approach . I understand the Problem well . But I want to solve this and I am not getting How to solve it ?? Your Kind help may be very Valuable for me in solving this types of problem.

I Just want some Tutorial about How to solve this problem / this type of Problems .... Any English / Bangla ( Bangladeshi Language) Tutorials are very helpful in that case .

P.S : It would be better if you provide some tutorials related to this Types of Problems not just for this Problem.

• 0

By ssavi, history, 8 years ago,

Hi Experts of CF .

I am in a Fix. Hope someone of You can help me out . Here is my Problem :

Sometimes we can see there are several Problems whose Input Data co-ordinated with a Test Case & Several Tests under it. But It does not mention How many Data we have to take as input for a several Test Case . It just mentioned there that There would be a Blank line between Two Consecutive Test Cases . Even if There will be a Blank line between The input Number of Test Case & the First Test Case .As well as there will be a Blank Line between the Last & Second Last Case .But there is No Terminating Empty line after the Last test Case . For Example

3

1
2
3

1
2
3

1
2
3


Now My Question How Can I take this Type of Inputs maintaining The Case Blocks .

Related Problem : https://uva.onlinejudge.org/external/4/497.pdf

• 0

By ssavi, history, 9 years ago,

[ UPD : Solved . The process what i am thinking worked . Just left the point of removing edges. just take the cost of Airports if any edges cost is equal / greater than "Cost of Airport " ]

I know that's a MST problem . And I found some point of Placing Airports . My idea is :

1. I will run a MST .
2. If the MST is able to connect all the Nodes then I Place just One Airport initially. And Then if the Cost of an Edge is Greater than or equal to the " Cost of Making an Airport " then I will place another Airport there & then Remove the Edge's Cost.
3. If the is not able to connect all the Nodes then I Place an Air Port where the Parent of a Node is Equal to the Node itself including if the Cost of an Edge is Greater than or equal to the " Cost of Making an Airport " then I will place another Airport there & then Remove the Edge's Cost.

Am I Correct ?

If I am not Correct then Please give some Idea where am I doing Mistakes ???

If Correct Then Please Give some suggestion about How Can I do this regarding the Following Points :

i) Do I have to Check all Edges ( If there is Repetition of an Edge Multiple times with Several Cost ) or i just Have to Check (n-1) edges ??

ii) How can I place The Airports if the Cost of an Edge is Greater than or equal to the " Cost of Making an Airport " & Remove the edges Adjacent to it with Same/ Greater Cost .

[ My English is Bad. Sorry for that ]

• +1

By ssavi, history, 9 years ago,

Hi CF Authority . I want to know about Cheat Detection . I know I'll get some Negative Vote for this Entry .

At today's Contest . I have solved two Problems in time ... My Codes are identical to another user's Code . Because that user collect the Code from me ( And why do I care what if he/she has done with my Solution .CZ I have solved myself. ).. .. And submit & Also that user solved one Extra Problem .... Unfortunately I will not be able to Do this . CF authority can check my Submission time & my identical's submission ( CF authority I won't reveal this name because you know about my Identical ") .

I just want to know why my submissions skipped ??? Why I would get a Penalty of Ratings .

Everyone do contest here to learn, train & grow up their Ratings .

What was my mistake ?

• -25

By ssavi, history, 9 years ago,

Hi Experts . I have about to Solve this Simple Floyd Warshall problem . I wrote the Code & Test the Random Inputs & Outputs of uDebug . They are okey for my Code . But I don't know Why I am getting Wrong Answer ??? What is the Critical Points I am missing ?? Please help me in finding out the Critical Points of the Problems ...

=> My Code : http://ideone.com/ZRGBBr

[ Some Critical Tests and Points are Appreciable ]

• 0

By ssavi, history, 9 years ago,

Today I have Faced an Unusual problem ..... I have Submitted 2 Solution in Today's Contest DIV — 2. While contest is Running It shows Those twos are AC . But After a while I have seen that My Submission are Skipped ? ? And It shows I didn't register myself into the Contest .. Then How can I submitted those code at Contest Time ?

My Submission : ( Problem B ) http://codeforces.com/contest/579/submission/13042381

Why I have faced this Problem ??

• -16

By ssavi, 10 years ago,

Attention to the Code Forces Authority . How to Hack a Solution ?? How Can I lock a code to get prevent from Hacking ?? I am newbie . I have solved a problem at today's Contest . And my code has been Hacked . Can anyone please help ??

• -16