[gcj] Re: C++, Parenting Partnering Returns, Qualification Round 2020. Help to find out the cause for fault!!!

2020-04-06 Thread Leandro Coutinho
Does your code print the answer in the original order?

On Monday, April 6, 2020 at 9:45:39 PM UTC-3, Olena Lizina wrote:
>
> Hi all,
>
> I didn't pass the Qualification Round 2020 because stuck with Parenting 
> Partnering Returns.
> My solution passes the Sample test cases, but failed on the first Test Set.
>
> I wrote unit tests and tried different data sets to test my code, but the 
> Google System didn't accept it.
> Today I checked solutions of others. Found an interesting solution and 
> tried to find out what did I miss.
> Found nothing :-(
>
> Can anybody help my to find some corner cases that I missed?
> Please!
>
> #include 
> #include 
> #include 
>
> using namespace std;
>
> class Activity
> {
> public:
>Activity(const int startTime, const int endTime)
>   : m_startTime{startTime}
>   , m_endTime{endTime}
>{
>}
>
>bool overlaps(const Activity& other) const
>{
>   bool result {true};
>   if (m_startTime > other.m_startTime)
>   {
>  result = m_startTime < other.m_endTime;
>   }
>   else
>   {
>  result = other.m_startTime < m_endTime;
>   }
>   return result;
>}
>
>int m_startTime;
>int m_endTime;
> };
>
> class Schedule
> {
> public:
>void addActivity(const Activity& activity)
>{
>   m_activities.push_back(activity);
>}
>
>void sortActivities()
>{
>   std::sort(m_activities.begin(), m_activities.end(), [](Activity lhs, 
> Activity rhs)
> {
>return lhs.m_startTime < rhs.m_startTime;
> });
>}
>
>std::string getSchedule()
>{
>   std::string res;
>
>   std::vector Jamies;
>   std::vector Camerons;
>
>   for (size_t i = 0; i < m_activities.size(); ++i)
>   {
>  auto& currActivity = m_activities.at(i);
>  if (Jamies.cend() == std::find_if(Jamies.cbegin(), Jamies.cend(), 
> [](const Activity& activity)
>{
>   return activity.overlaps(
> currActivity);
>}))
>  {
> Jamies.push_back(currActivity);
> res += "J";
>  }
>  else if (Camerons.cend() == std::find_if(Camerons.cbegin(), 
> Camerons.cend(), [](const Activity& activity)
>   {
>  return activity.
> overlaps(currActivity);
>   }))
>  {
> Camerons.push_back(currActivity);
> res += "C";
>  }
>  else
>  {
> res = "IMPOSSIBLE";
> break;
>  }
>   }
>   return res;
>}
> private:
>std::vector m_activities;
> };
>
> void assert(const std::string& func, const bool validate)
> {
>if (validate)
>{
>   std::cout << func << ": OK" << std::endl;
>}
>else
>{
>   std::cout << func << ": NOK" << std::endl;
>}
> }
>
> void testActivity()
> {
>{
>   Activity lhs(0, 1);
>   Activity rhs(0, 1);
>   assert(__FUNCTION__, lhs.overlaps(rhs));
>   assert(__FUNCTION__, rhs.overlaps(lhs));
>}
>{
>   Activity lhs(0, 10);
>   Activity rhs(0, 1);
>   assert(__FUNCTION__, lhs.overlaps(rhs));
>   assert(__FUNCTION__, rhs.overlaps(lhs));
>}
>{
>   Activity lhs(0, 10);
>   Activity rhs(3, 10);
>   assert(__FUNCTION__, lhs.overlaps(rhs));
>   assert(__FUNCTION__, rhs.overlaps(lhs));
>}
>{
>   Activity lhs(0, 10);
>   Activity rhs(10, 15);
>   assert(__FUNCTION__, !lhs.overlaps(rhs));
>   assert(__FUNCTION__, !rhs.overlaps(lhs));
>}
>{
>   Activity lhs(0, 10);
>   Activity rhs(11, 15);
>   assert(__FUNCTION__, !lhs.overlaps(rhs));
>   assert(__FUNCTION__, !rhs.overlaps(lhs));
>}
>{
>   Activity lhs(15, 20);
>   Activity rhs(10, 15);
>   assert(__FUNCTION__, !lhs.overlaps(rhs));
>   assert(__FUNCTION__, !rhs.overlaps(lhs));
>}
> }
>
> void testSchedule()
> {
>{
>   Schedule today;
>   today.addActivity(Activity{360, 480});
>   today.addActivity(Activity{420, 540});
>   today.addActivity(Activity{600, 660});
>   assert(__FUNCTION__, (today.getSchedule() == "JCJ"));
>}
>{
>   Schedule today;
>   today.addActivity(Activity{0, 1440});
>   today.addActivity(Activity{1, 3});
>   today.addActivity(Activity{2, 4});
>   assert(__FUNCTION__, (today.getSchedule() == "IMPOSSIBLE"));
>}
>{
>   Schedule today;
>   today.addActivity(Activity{99, 150});
>   today.addActivity(Activity{1, 100});
>   today.addActivity(Activity{100, 301});
>   today.addActivity(Activity{2, 5});
>   today.addActivity(Activity{150, 250});
>   assert(__FUNCTION__, (today.getSchedule() == "JCCJJ"));
>}
>{
>   Schedule 

Re: [gcj] The Qual Round is over!

2018-04-08 Thread Leandro Coutinho
Thank you Bartholomew !

What is TLE?
*Temporal lobe epilepsy? :D*

Em Dom, 8 de abr de 2018 17:27, Bartholomew Furrow <fur...@gmail.com>
escreveu:

> I have a few thoughts, and I want to emphasize once again that although I
> used to be on the Code Jam team, I no longer am.
>
> First: I don't think Hidden sets are really run after the contest. At the
> end of the Qualification Round, all scores were visible immediately. We
> used to judge Large inputs as they were submitted and just not show the
> results until the end, and I'm assuming that's true with the new platform.
>
> Second: "Hidden/large should be about performance" is a reasonable
> philosophy, but it isn't a philosophy that Code Jam has held to
> historically. You can find lots of problems where there's a simple
> algorithm that would be correct on the Small, and incorrect (not just slow)
> on the Large. With that said, all data sets are designed to test the
> program as much as possible, so if your code was broken by the Invisible
> input in a way that it *could* have been broken on the Visible input,
> that's certainly something they'll be trying to avoid.
>
> Third, about whether we should know whether our submissions timed out or
> not on Hidden sets: It's certainly true that that's a difference, though as
> Felix points out it isn't like you could *do* anything about it before
> unless you acted very fast. You just knew you didn't have the points, which
> typically doesn't matter all *that* much.
>
> You might be interested to hear that when we first designed the
> small/large input set system, we viewed the ability to see TLEs as a
> down-side of the new system, when for Large inputs you weren't supposed to
> know whether you got it. It's interesting to see it come around the other
> way!
>
> I *would* like to see the running time for my Visible submissions, since
> right now I don't have a sense for how quickly anything runs on the server,
> other than that making a 15x15 square on the Interactive problem for 100
> inputs takes more than 10 seconds.
>
> Cheers,
> Bartholomew
>
> On Sun, Apr 8, 2018 at 2:08 PM Leandro Coutinho <lescoutinh...@gmail.com>
> wrote:
>
>> Hmm good point.
>>
>> So CodeJam is worst now.
>>
>> Worst is not the best word. The previous system was really good.
>>
>> Em Dom, 8 de abr de 2018 17:04, Xiongqi ZHANG <zhangxion...@gmail.com>
>> escreveu:
>>
>>> The hidden test is run after the contents ends. How is it possible to
>>> tell you that your program will finish or not if it was not actually run?
>>> On Sun, Apr 8, 2018 at 12:56 PM Leandro Coutinho <
>>> lescoutinh...@gmail.com> wrote:
>>>
>>>> Good point.
>>>>
>>>> They should let us know if the program finished on time. They can do
>>>> this without saying that it is correct or not.
>>>>
>>>> The other problem is about correctness. Hidden/large should be about
>>>> performance ...
>>>>
>>>> Em Dom, 8 de abr de 2018 16:43, Felix Voituret <
>>>> felix.voitu...@gmail.com> escreveu:
>>>>
>>>>> Well the real difference here is that you do not know if the time
>>>>> limit was respected for the hidden dataset (previously large). So you
>>>>> really has to ensure required points from visible one that you can control
>>>>> unless you estimate correctly time complexity regarding dataset limits.
>>>>>
>>>>> Envoyé de mon iPhone
>>>>>
>>>>> > Le 8 avr. 2018 à 20:29, newbie007 <lescoutinh...@gmail.com> a écrit
>>>>> :
>>>>> >
>>>>> > Usually in the qualification round the first two problems are simple
>>>>> and with no tricks.
>>>>> >
>>>>> > I got A and B correct for the small data sets, so I assumed it was
>>>>> fine.
>>>>> >
>>>>> > But then wrong for A large and time exceed for B large. Oo
>>>>> >
>>>>> > Probably I was too careless, but I think CodeJam missed the
>>>>> qualification round purpose this year.
>>>>> >
>>>>> > --
>>>>> > You received this message because you are subscribed to the Google
>>>>> Groups "Google Code Jam" group.
>>>>> > To unsubscribe from this group and stop receiving emails from it,
>>>>> send an email to google-code+unsubscr...@googlegroups.com.
>>>>> > To post to this group, send email to google-code

Re: [gcj] The Qual Round is over!

2018-04-08 Thread Leandro Coutinho
Hmm good point.

So CodeJam is worst now.

Worst is not the best word. The previous system was really good.

Em Dom, 8 de abr de 2018 17:04, Xiongqi ZHANG <zhangxion...@gmail.com>
escreveu:

> The hidden test is run after the contents ends. How is it possible to tell
> you that your program will finish or not if it was not actually run?
> On Sun, Apr 8, 2018 at 12:56 PM Leandro Coutinho <lescoutinh...@gmail.com>
> wrote:
>
>> Good point.
>>
>> They should let us know if the program finished on time. They can do this
>> without saying that it is correct or not.
>>
>> The other problem is about correctness. Hidden/large should be about
>> performance ...
>>
>> Em Dom, 8 de abr de 2018 16:43, Felix Voituret <felix.voitu...@gmail.com>
>> escreveu:
>>
>>> Well the real difference here is that you do not know if the time limit
>>> was respected for the hidden dataset (previously large). So you really has
>>> to ensure required points from visible one that you can control unless you
>>> estimate correctly time complexity regarding dataset limits.
>>>
>>> Envoyé de mon iPhone
>>>
>>> > Le 8 avr. 2018 à 20:29, newbie007 <lescoutinh...@gmail.com> a écrit :
>>> >
>>> > Usually in the qualification round the first two problems are simple
>>> and with no tricks.
>>> >
>>> > I got A and B correct for the small data sets, so I assumed it was
>>> fine.
>>> >
>>> > But then wrong for A large and time exceed for B large. Oo
>>> >
>>> > Probably I was too careless, but I think CodeJam missed the
>>> qualification round purpose this year.
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> > To post to this group, send email to google-code@googlegroups.com.
>>> > To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/1c05cf0e-d772-4b96-879c-b61535bd9145%40googlegroups.com
>>> .
>>> > For more options, visit https://groups.google.com/d/optout.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google Code Jam" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-code+unsubscr...@googlegroups.com.
>>> To post to this group, send email to google-code@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/google-code/04C481DF-7DFB-4A75-9A85-C2DFF300CE09%40gmail.com
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/google-code/CAN6UTazuPkM5riqnVc-39%3D6E0Z0YO0J%3DHdaGugYWQUJN%3Day7XA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAN6UTazuPkM5riqnVc-39%3D6E0Z0YO0J%3DHdaGugYWQUJN%3Day7XA%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-code/CAGDEU-%2BAV38V8MWAYvrvOJTvuH%2BROa_gAzEouYK2EUOS_kD1QA%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAGDEU-%2BAV38V8MWAYvrvOJTvuH%2BROa_gAzEouYK2EUOS_kD1QA%40mail.gmail.com?utm_medium=email_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTawbYGQ-%3DHpn_2KgJ%3D0OVFvw6Qjudov52wh4dnWUTVjFuA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] The 2018 Qual Round has started!

2018-04-07 Thread Leandro Coutinho
ops. sorry. forget it

On Sat, Apr 7, 2018 at 11:18 AM, Leandro Coutinho <lescoutinh...@gmail.com>
wrote:

> Trouble Sort:
>
> i < len(L)-2;
>
> Shouldn't it be (L) - 3 ?? Index out of bound ?!!!
>
> On Fri, Apr 6, 2018 at 8:04 PM, 'Ian Tullis' via Google Code Jam <
> google-code@googlegroups.com> wrote:
>
>> Hi Everyone,
>>
>> The Qualification Round <https://codejam.withgoogle.com/2018/> has
>> officially begun!
>>
>> We will temporarily be putting messages in this group on hold during the
>> qualification round and will resume as normal after 02:00 UTC on Sunday,
>> April 8, 2018.
>>
>> If you have any questions or experience any issues during the round,
>> check out our FAQ <https://codejam.withgoogle.com/codejam/resources/faq>
>> page for support. If you don’t find the answer you need there, please
>> contact us at code...@google.com.
>>
>> Good luck!
>>
>> - Ian, for the Code Jam team
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-code/2e130ca1-4f21-4fde-847e-df67dd442291%40googlegroups.com
>> <https://groups.google.com/d/msgid/google-code/2e130ca1-4f21-4fde-847e-df67dd442291%40googlegroups.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTayhhS5kJ5nYu-orRxsZKMxOMmV-0W7zVRtHD4UejcN7Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] The 2018 Qual Round has started!

2018-04-07 Thread Leandro Coutinho
Trouble Sort:

i < len(L)-2;

Shouldn't it be (L) - 3 ?? Index out of bound ?!!!

On Fri, Apr 6, 2018 at 8:04 PM, 'Ian Tullis' via Google Code Jam <
google-code@googlegroups.com> wrote:

> Hi Everyone,
>
> The Qualification Round  has
> officially begun!
>
> We will temporarily be putting messages in this group on hold during the
> qualification round and will resume as normal after 02:00 UTC on Sunday,
> April 8, 2018.
>
> If you have any questions or experience any issues during the round, check
> out our FAQ  page
> for support. If you don’t find the answer you need there, please contact us
> at code...@google.com.
>
> Good luck!
>
> - Ian, for the Code Jam team
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/2e130ca1-4f21-4fde-847e-df67dd442291%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTawrm1MwFoX_HOS7dR2Kz9RQ%2BtQD7hUJ%3DzjmSwrB2x-K1Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Parenting Partnering: Analysis

2017-05-02 Thread Leandro Coutinho
Thanks a lot Paul and Abhishek! =)

On Tue, May 2, 2017 at 2:28 AM, Abhishek Nanda  wrote:

> C (0-720) and J(720-1440) is two exchanges, one at time 0 and another at
> time 720. The exchange at time 0 is the same as the exchange at time 1440
> depending on which day you count midnight.
>
> What you've listed is sample 4, and the answer is indeed 4 for it.
>
> Sample 3's input is:
> 1 1
> 1439 1440
> 0 1
>
> Can be done using two exchanges: C(0-720) and J(720-1440).
>
>
> On 2 May 2017 at 06:59, newbie007  wrote:
>
>> is 0 midnight?
>> is 1440 midnight?
>>
>> why if C (0-720) and J(720-1440) is not only ONE exchange?
>>
>>  I didn't understand sample case 3:
>> 2 2
>> 0 1
>> 1439 1440
>> 1438 1439
>> 1 2
>>
>> time taking care of the baby:
>> James..: 0-1,  720-1438, 1439-1440
>> Cameron: 1-720, 1438-1439
>>
>> I counted 4 exchanges! :/
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-code/29642b75-2d92-4739-93bf-3ebfad7197f3%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAKK-4hoCByfwUSebwhff0QN9N6turPsjmK
> Th_im9vCSkidTtwA%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaxtTbYix9wnXksPPzBQABF%2BfJkQBd_KL_jrY-z3schM8Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Round 1s are over, see the scoreboard and analysis of 1C

2017-04-30 Thread Leandro Coutinho
thanks pablo and code jam team for making the analyses available so fast.

Em 30/04/2017 13:20, "'Pablo Heiber' via Google Code Jam" <
google-code@googlegroups.com> escreveu:

> Hi,
>
> With the end of Round 1C, our Round 1 month comes to a close.
> Congratulations to the 3000 people that advanced to Google Code Jam's Round
> 2 and Distributed Round 1. We hope everyone had fun, regardless of whether
> you advanced or not. You are all welcome to join us in our upcoming rounds,
> by competing or watching and trying the problems in practice right after
> rounds.
>
> The scoreboard for Round 1C, in case you missed it, is here:
> https://code.google.com/codejam/contest/3274486/scoreboard?c=3274486
>
> Remember that these results are pending review. We will send final notices
> of advancement soon.
>
> The analysis for 1C's problems are also posted here:
> https://code.google.com/codejam/contest/3274486/dashboard#s=a
>
> Thanks for participating!
> Pablo
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CANa5jcAsZROPr05p0-_DEXdSa0uzBFbo8nYOOUPwfLt-
> ZSZ2Kw%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTay-NknNhmtgYxWV8vUA0b-_ZsVp26-nEtt4XNZtkiT-9w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: What stumped people in Stable Neigh-bors

2017-04-30 Thread Leandro Coutinho
which I think should not be the case. large should be about efficience, not
about extra edge cases.

Em 24/04/2017 04:14, "Xiongqi ZHANG"  escreveu:

> Sometimes you are given a relative weak test cases for small.
> In such cases, people get 'Correct' verdict for their small even when
> their missed some edge cases.
>
> > I noticed only 31% correct in large attempts for Stable Neigh-bors.
> > Where were the pitfalls causing so many to think they had a solution but
> still fail somewhere, are there extra edge cases.
> > I can see many edge cases you can miss which will affect both small and
> large but don't see edge cases exclusive to the large except the YVYV which
> appeared in the problem statement (I would have missed it otherwise)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/8ea62ccb-ba4c-4cac-b322-3c0041046ccf%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTayjd3uLr%3DN-9Xfx%3DfrypB_dXVZhjxyK-D%3DLdNjRkoaK9g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] wrong output submitted

2017-04-13 Thread Leandro Coutinho
nice idea. they could check if it is the same output and same source file
from a failed attempt, assuming it would be easy for them to check this.



On Thu, Apr 13, 2017 at 4:30 PM, Bartholomew Furrow 
wrote:

> Is it possible for google to reject submissions if the answers are the
>> same as a previously accepted and correct small submission?
>>
>> For incorrect submissions or not-yet-marked large submissions I think it
>> is impossible to reject because the answer is not directly linked to a
>> correct answer for a different question. Still, a warning message would be
>> nice.
>>
>
> As I understand it, your idea is:
>
> When I submit output for a problem, look at all previous correct Small
> outputs I've submitted for that problem and make sure it's different from
> all of them. If not, reject the submission in the same way as files that
> don't start with "Case #1: " are rejected.
>
> That sounds like a great idea to me. I considered it when I was still
> working at Google, but never had the time. Maybe that's something they can
> work on now; I wonder how often it happens that people submit the same
> output for their Large as their Small. I'm guessing it's possible to check.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAHaiWHMSa%3DmME9fmUTq8gWjexst-
> ZQyWxFUgB5gEDs5vhmJmQQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaxmwp8G3tdN7u3q6nNUdLV5%2B1TsA8-qPzJMxQfWoLPnGw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Problem D Fashion Show

2017-04-12 Thread Leandro Coutinho
Thank you. And thanks Luke too.

Maybe a future problem could change to:

   - Whenever any two models share a row or column, this row or column must
   have at least one +.
   - Whenever any two models share a diagonal of the grid, this diagonal
   must have at least one x.


Do you think it would be a harder problem?


On Wed, Apr 12, 2017 at 8:39 PM, Paul Smith <p...@pollyandpaul.co.uk> wrote:

> No. Whenever two symbols are in the same row, one of them must be a +. The
> column has nothing to do with it.
>
> The middle row has 3 such pairs -
> the x and the + are in the same row (this is ok because one of them is a +)
> The + and the o are in the same row (this is ok because one of them is a +)
> The x and o are in the same row (this is not ok, neither of these is a +)
>
> An equivalent statement is that in any row at most one symbol is allowed
> to not be a +
> On Wed, 12 Apr 2017 at 23:29, Leandro Coutinho <lescoutinh...@gmail.com>
> wrote:
>
>> Ok. But I think the sentence is wrong (or at least very misleading).
>>
>> Maybe it should be:
>>
>> The middle row has a pair of models (x and o) that does not include a + *in
>> their columns*.
>>
>> On Wed, Apr 12, 2017 at 7:04 PM, Luke Pebody <l...@pebody.org> wrote:
>>
>> Yes, but of any two models on a row or column, one must be a +. Since
>> there are two on that row that are not a +, that condition is not satisfied
>>
>> On 12 Apr 2017 10:58 p.m., "newbie007" <lescoutinh...@gmail.com> wrote:
>>
>> https://code.google.com/codejam/contest/3264486/dashboard#s=p3
>> [quote]
>> ...
>> x+o
>> .+.
>>
>> The middle row has a pair of models (x and o) that does not include a +.
>> [/quote]
>>
>> I didn't understand this part.
>> The middle row HAS a +
>>
>> :(
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/google-code/f23951a1-9968-49a6-b3fe-b2400a61a863%40googlegroups.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/google-code/CAECKw-O1DFOzK1vOc8LspypehADd4HcLjaDo
>> K2nBta4fhhowgQ%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAECKw-O1DFOzK1vOc8LspypehADd4HcLjaDoK2nBta4fhhowgQ%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/
>> msgid/google-code/CAN6UTawOxbApK3meBWqhVWuiuNoCb
>> X_6tHRO9sXbPzxfDNcDTg%40mail.gmail.com
>> <https://groups.google.com/d/msgid/google-code/CAN6UTawOxbApK3meBWqhVWuiuNoCbX_6tHRO9sXbPzxfDNcDTg%40mail.gmail.com?utm_medium=email_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAJej63%2B4KaQy_SH7OTRM9i4h8DcckCmFiQauq81fa_
> cBwLpBGw%40mail.gmail.com
> <https://groups.google.com/d/msgid/google-code/CAJej63%2B4KaQy_SH7OTRM9i4h8DcckCmFiQauq81fa_cBwLpBGw%40mail.gmail.com?utm_medium=email_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTawt1T_%3DrgV5xx5DLWhNU5S_BH0Sf4guVhJ8XfqApcbEjQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Problem D Fashion Show

2017-04-12 Thread Leandro Coutinho
Ok. But I think the sentence is wrong (or at least very misleading).

Maybe it should be:

The middle row has a pair of models (x and o) that does not include a + *in
their columns*.

On Wed, Apr 12, 2017 at 7:04 PM, Luke Pebody  wrote:

> Yes, but of any two models on a row or column, one must be a +. Since
> there are two on that row that are not a +, that condition is not satisfied
>
> On 12 Apr 2017 10:58 p.m., "newbie007"  wrote:
>
>> https://code.google.com/codejam/contest/3264486/dashboard#s=p3
>> [quote]
>> ...
>> x+o
>> .+.
>>
>> The middle row has a pair of models (x and o) that does not include a +.
>> [/quote]
>>
>> I didn't understand this part.
>> The middle row HAS a +
>>
>> :(
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google Code Jam" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to google-code+unsubscr...@googlegroups.com.
>> To post to this group, send email to google-code@googlegroups.com.
>> To view this discussion on the web visit https://groups.google.com/d/ms
>> gid/google-code/f23951a1-9968-49a6-b3fe-b2400a61a863%40googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/CAECKw-O1DFOzK1vOc8LspypehADd4HcLjaDo
> K2nBta4fhhowgQ%40mail.gmail.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTawOxbApK3meBWqhVWuiuNoCbX_6tHRO9sXbPzxfDNcDTg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Submission of Files

2017-04-09 Thread Leandro Coutinho
search google for a java file tutorial.
you can use scanner and printwriter

Em 10/04/2017 00:07, "Abhishek Pal" 
escreveu:

> Okay. So I have programmed in java. Now the problem I'm facing is that my
> program takes input directly from user and prints the output. I'm using
> BlueJ as my IDE and hence it opens a window which is like the following on
> running the program:
>
> Enter the number of test cases:
> 4
> Enter the number:
> 132
> Enter the number:
> 7
> Enter the number:
> 1000
> Enter the number:
> 145
> Case #1: 129
> Case #2: 7
> Case #3: 999
> Case #4: 145
>
>
> This is what my output looks like.
> The user directly enters the data and the output is produced.
> But how am I supposed to enter the data from the file they have provided
> because it has like 100 inputs which are impossible to enter in 4 minutes.
> SO the conclusion is:
>
> What type of source code to submit? : .java file type or copy the code
> into notepad and upload a .txt file.
>
> How to produce an output file? for java.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Code Jam" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-code+unsubscr...@googlegroups.com.
> To post to this group, send email to google-code@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-code/21c2b202-3138-465e-83ce-af6da2f4abe8%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaywziK764eBemw3T9f1qV%3DwWy1W83RwQR1t2fs4ZyAmjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Any thoughts about the rules?

2014-10-09 Thread Leandro Coutinho
I would like if the problems analyses had attached a working solution for
newbies, with lots of comments. =D
Em 08/10/2014 19:46, Bartholomew Furrow fur...@gmail.com escreveu:

 Hey Code Jammers,

 It's the time of year where we're revisiting the rules from 2014 to see
 what we want to change for 2015. For everyone who participated in Google
 Code Jam 2014: what would you like to see changed about the rules? Reply
 back to me, or to this list, or to code...@google.com, with your ideas. I
 can't promise anything, but we'd love to hear what you'd like to see.

 Some examples of things we're looking at:
 - The rules right now don't allow Excel because it isn't free; but there
 are lots of great free alternatives, so we'll likely allow it.
 - If you use a non-free language in the Qualification Round, I think the
 rules right now say that you lose your points for that input. But a lot of
 people who are competing in the Qualification Round are competing for the
 first time and may not have realized that they've done something wrong, so
 we'll look at explicitly allowing that and sending them a warning email
 about future rounds.


 There are also bigger changes afoot, but I won't spoil the surprise...

 Cheers!
 Bartholomew

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAHaiWHNZZgncT0w6ZMpc0iF_-F-vc%3DBzgpfV%2BYm9103ou7YKng%40mail.gmail.com
 https://groups.google.com/d/msgid/google-code/CAHaiWHNZZgncT0w6ZMpc0iF_-F-vc%3DBzgpfV%2BYm9103ou7YKng%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaz_sm5RtF2b%2BMpcwc0hNr4ZygeAyLh%3Dczb8PcHnwMch%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Problem A

2014-04-28 Thread Leandro Coutinho
Interesting someone that isn't a programmer professionally and like this
stuff.


On Mon, Apr 28, 2014 at 10:49 AM, Stanislav Zholnin 
stanislav.zhol...@gmail.com wrote:

 I think emotionally being in the middle (definitely not novice, but too
 far from top performers) is very difficult. On one hand you know how much
 you've put in already, on the other way you see light years you need to put
 in to get even a little closer to top performers. Probably even worse then
 being novice, because you better realize how far you are.

 In my case this is more like a hobby - I am not programmer in professional
 life, but I still don't participate in competitions without desire to win
 :).

 Last week was bad for my programming skills - I participated in first SRM
 at Topcoder. Being first time, I was assigned to 2nd Division and problems
 were easy. So I solved all them first in my room. Happily looking at myself
 at the first place - I waited for another 40 minutes for everybody to
 finish. Then challenge phase came - everybody checked my solutions, nobody
 challenged.

 Then system tests - and all my problems fail, and I fall down to last
 place. After careful research - in first problem I forgot class wrapper, in
 second problem there was some bug with indentation - after I retabbed
 every line it started working properly - python stuff, in third problem one
 testcase took more then 2 seconds - again python stuff. :) So I think
 failing Round 1A in Codejam was proper result for such week.

 Hope to do better this time.

 Good luck to you and thanks for support. I know this forum is not
 psychological hotline, so sorry for bringing up this silly topic.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/818087bc-d4dc-49ff-8845-0513d0a335a8%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTayDYVtzEAfeJTfZLxwPcWTS-SMZf4O56rGd8UAO%2BbYFLQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Minesweeper backtracking approach

2014-04-25 Thread Leandro Coutinho
Thanks a lot for sharing Emil. Nice code.


On Fri, Apr 25, 2014 at 8:02 AM, Emil Maskovsky emil.maskov...@gmail.comwrote:

 Hi,

 I think I implemented it nearly the same way as they describe it - look
 for my username styryx in the results panel or see the code here:
 http://pastebin.com/69dh2xSV

 With one difference that I checked for invalid configurations for next
 line when generating the current line, so that I did not need to revert
 (prune) when the configuration would be invalid (those are the checks
 which result in --run in the code - as in the principle, only if there is
 one free field left on the line and it is not a single column field, the
 configuration is invalid).

 There is still special handling of the first line, as the first two lines
 must have the exact same count of free fields, the next lines then can have
 a lower count.


 On Friday, April 25, 2014 4:03:08 AM UTC+2, newbie007 wrote:
  Hi,
 
  In the problem's analysis they mention the use of backtracking to solve
 the problem:
  https://code.google.com/codejam/contest/2974486/dashboard#s=aa=2
 
  They also say that it's an easier approach, but maybe it's harder to
 validate if the configuration is valid than enumerate the corner cases?
 
  Does someone can show a solution for this problem implementing
 backtracking or point to some coder that implemented it?
 
  Thank you.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/d3ecd581-f7fd-466d-9c66-e682d1a6b1f8%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaxh6MS3wQdJxoG02XNhQ9o%2BTjCy%2Bg%3D_Qx3g7yiFkbmooQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Qualification Round Contest Analysis

2014-04-24 Thread Leandro Coutinho
I agree Alex. By the way it should be something they already had before the
contest start, and they probably have, so I don't understand why not
disclose.


On Thu, Apr 24, 2014 at 6:50 PM, Alex Polozov polozov.a...@gmail.comwrote:


 By the way, one could argue that such a delay diminishes the educational
 value of the contest. Only one day is left before the Round 1A, and we
 still haven't got any analysis of the Qualification Round. I would expect
 the participants to get some time to read the official problem analysis, to
 debug their solutions, to try to implement official solutions, to learn
 more about the theoretic concepts mentioned in the analysis - essentially
 to prepare for the next round. If there is no such time, then how are the
 participants expected to learn on their own mistakes if no correct
 solution is provided? Various forums, groups, and other third-party
 discussions don't really serve as a full-fledged replacement for a complete
 analysis.



-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaxOh3oYS7TpJLUOR0SVKT45x2_9RdS6Sq8egpFeO6xS%2Bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: There should be a way to connect with other participants

2014-04-15 Thread Leandro Coutinho
Really?! Where are you from? :)
Em 15/04/2014 15:21, Stanislav Zholnin stanislav.zhol...@gmail.com
escreveu:

 I don't think that there is need for messaging system. But probably there
 should be some very simple profile page where you can look at City /
 Country / e-mail or better link to Facebook page, as long as participant
 wants to be contacted.

 I don't have problem of communicating with participant from country I am
 in because there are no other participants :)

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/9f973410-b66e-4d8b-9da3-b5330f82acee%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTawmCDt%3D3p3%3DKVmrJWmwKRnVTe0f%3DxnEeTmZMjyJrZQmJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Deceitful War

2014-04-13 Thread Leandro Coutinho
Naomi went to the dark side.
Now she is a corrupted person...
Em 13/04/2014 11:06, Luke Pebody l...@pebody.org escreveu:

 Ken is very trusting.

 Sent from my iPad

 On 13 Apr 2014, at 12:51, Richard Braakman gta...@clueonic.net wrote:

  To get 8, Naomi takes 0.300, 0.389, 0.557, 0.832, 0.899, 0.907, 0.959
 and
  0.992, saying each is 0.999.
  Kurt will choose 0.215, 0.271, 0.341, 0.458, 0.520, 0.521, 0.700 and
 0.728
  and be none the wiser.
 
  Finally Naomi takes 0.186 and says 0.915, and Kurt chooses 0.916 and
 gets
  1 point.
 
  If I were Ken I would get a bit suspicious after that game :)
 
  --
  Richard Braakman
 
  --
  You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
  To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
  To post to this group, send email to google-code@googlegroups.com.
  To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/73a70d21d8a9c6c5fc6fc0c810f02da0.squirrel%40clueonic.net
 .
  For more options, visit https://groups.google.com/d/optout.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/9DE2DB43-6936-4BD9-A468-EA14F201F2C3%40pebody.org
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTayC-ZBkXYSxbHruwe0pkA8Ky9RmCWamjH4VjHDZvufNhQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Deceitful War

2014-04-12 Thread Leandro Coutinho
People can't help you here.
This problem is about finding the strategy for both War and Deceitful.
If someone explain to you why it's 8, then he would be telling you the
strategy. =)


On Sat, Apr 12, 2014 at 2:26 PM, Angel Java Lopez ajlopez2...@gmail.comwrote:

 Regarding:

 https://code.google.com/codejam/contest/2974486/dashboard#s=p3

 Why the sample case:
 9
 0.186 0.389 0.907 0.832 0.959 0.557 0.300 0.992 0.899
 0.916 0.728 0.271 0.520 0.700 0.521 0.215 0.341 0.458

 should give:

 Case #4: 8 4

 Which moves give 8 as result for Naomi?

 Angel Java Lopez
 @ajlopez

  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAMs%2BDqL8-G6anLjQoQrfPXQS49D1nL2EPrHfUcjfcvN76FoU%2Bg%40mail.gmail.comhttps://groups.google.com/d/msgid/google-code/CAMs%2BDqL8-G6anLjQoQrfPXQS49D1nL2EPrHfUcjfcvN76FoU%2Bg%40mail.gmail.com?utm_medium=emailutm_source=footer
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaxCTL_UsGExfKD4f%3DJhqX634BHihZCQJNa9zLX25O7r7A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] Re: Code performance concerns

2014-04-03 Thread Leandro Coutinho
Nice tips *@Stanislav.*Thank you.


On Thu, Apr 3, 2014 at 12:41 PM, Stanislav Zholnin 
stanislav.zhol...@gmail.com wrote:

 I would like also to add that I often use the following tactics:

 Very often for small input much easier algorithm / implementation does the
 trick. Sometimes you can even come up with brute force and solve it withing
 approved time. What I often do is doing program for small input as simply
 as possible - no difficult algorithms, no optimization, straight. In my
 case (and probably it is the same with many people) this approach is less
 prone to errors.

 After I submitted small input and ensured that it is correct, I switch my
 helper code template to verify mode - this is very helpful and you should
 include it into your working code template. What it does is it runs the
 program, but instead of writing answer file it checks new answer against
 those which are in the file.

 After switching to this mode I start making adjustments to algorithm /
 optimizations. Everytime I run it I see if my program still produces
 correct results.

 In majority of cases, if I did all adjustments I wanted and it still
 produces correct output for small case it will produce correct output for
 large. There are things which can go wrong - yes, but it is always the case.

 Alternative I am trying to avoid here is the following:
 Trying to implement best possible algorithm from the beginning possibly
 with several bugs and several small inputs used to clear up those bugs.
 Every small input is a time penalty. Very often avoiding just one time
 penalty already gives enough time to write simple straightforward solution.

 Good example of this approach - problem from round 1C last year - Great
 Wall. It is C problem, so was the most difficult in a round. Small input is
 very easy - you just write program as it is written in problem statement.
 Large was difficult. But if you already have set of input/output you know
 to be correct, making adjustments to algorithm trying to make it faster is
 much-much safer.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/8258e667-4986-4845-83e5-7ee6f31d9b9f%40googlegroups.com
 .
 For more options, visit https://groups.google.com/d/optout.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTawQXw%3D3vb0abUwLHYNtU%3DWo78UkUxBb0hTQDVf5qPd%3Djw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [gcj] 2013 Finals analysis published

2013-09-06 Thread Leandro Coutinho
yes I agree, sorry. I thought maybe could be a simple answer, like he
joined google. =)
but that's ok. sorry again.


On Fri, Sep 6, 2013 at 9:15 PM, Bartholomew Furrow fur...@gmail.com wrote:

 Leandro,

 We can't really discuss why particular finalists didn't attend; it seems
 impolite to pass on that kind of information, even if it isn't terribly
 exciting. Sorry!

 Bartholomew


 On Fri, Sep 6, 2013 at 5:11 PM, Leandro Coutinho 
 lescoutinh...@gmail.comwrote:

 Hi Petr.

 Could you answer my question here, please?
 https://groups.google.com/forum/#!topic/google-code/36wJvrplduQ
 Maybe you know why tourist didn't attend the finals. Many were waiting to
 see his performance at the finals (you too, from an old post:
 http://petr-mitrichev.blogspot.com.br/2009/10/gennady-korotkevich.html =),
 so it's said that he didn't participate ... :/
 Thank you.


 On Fri, Sep 6, 2013 at 4:07 PM, Petr petr.mitric...@gmail.com wrote:

 The analysis for the final round is up at
 https://code.google.com/codejam/contest/2437491/dashboard#s=a

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/3a7d5121-0704-4b13-a4b6-878bb97e3f03%40googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.


  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAN6UTazQJat3xfU8QdNuWH4NpvMGt__Nn_iK52kAn7yv2nwi5Q%40mail.gmail.com
 .

 For more options, visit https://groups.google.com/groups/opt_out.


  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/CAHaiWHN2eeeGHqgPRFx4GsmVUzMn7ERSjg%3DvJvL%3DMhU06AyW0w%40mail.gmail.com
 .

 For more options, visit https://groups.google.com/groups/opt_out.


-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTayWtcQD141eAafs%2B6L3t_rPkc9jbNQhprjBn%2BHVKg8hJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [gcj] CodeShare (Website Idea / feedback would be great)

2013-07-11 Thread Leandro Coutinho
Hi. there are already other sites for this. But if you think it will be
different, go ahead.
Em 11/07/2013 14:07, Chris Dorman cdorm...@gmail.com escreveu:

 hey, I have been working on a long time dream that I have been having. Its
 called CodeShare. A website where everyone can share there code with
 everyone. Here is a preview of it, and if everyone thinks is a good idea. I
 will get a domain for it.

 Here is the link to the website: http://cdrom.co.nf/codeshare/

 Thanks, and best regards to all of you
 -Chris

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/google-code/f11090b6-a21c-46bf-ab86-5ff2f300cb5e%40googlegroups.com
 .
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-code/CAN6UTaw%2BH9NY%3DmRtKKAPFeUtpvy%3DGNEiPGWhDpBAVnrzrz9irw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj]

2013-05-13 Thread Leandro Coutinho
Change the logic. Look at eatmore solution.
Em 13/05/2013 08:03, Vaibhav Tulsyan wittynwise2...@gmail.com escreveu:

 I solved the problem in Java.
 My logic to solve the 'Consonants' problem is as follows:
 1. Find all possible substrings from the name of length 'n' or greater
 (using substring( ) function)
 2. In each substring, check if 'n' consonants appear consecutively.



 This is an O(N^4) solution. For names of length (10^6), I thought I'd
 use 'long' instead of 'int', but the substring( ) function works only
 for integers. What should I do in order to resolve this, if I intend
 to use the same logic? (Or should I change the logic)
 --
 Regards,
 Vaibhav Tulsyan.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] hai to all

2013-05-11 Thread Leandro Coutinho
Hello,

Reading the problem (
http://community.topcoder.com/stat?c=problem_statementpm=12540rd=15498),
I think it's like this:

- Maximum # deer that have two antlers: it's when whenever possible each
deer lost two antlers:
q = k / 2, r = k mod 2, max = N - q + r

- Minimum # deer that have two antlers: it's when whenever possible each
deer lost just one antler:
x = N - K, if x = 0, then min = x, else min = 0

public class DeerInZooDivTwo {


public int[] getminmax(int N, int K)
{
int min = N-K;
if(min  0) min = 0;
return new int[]{min, N-((K/2)+(K%2))};
}

public static void main(String[] args) {
DeerInZooDivTwo d = new DeerInZooDivTwo();
int[] xy = d.getminmax(3, 2);
System.out.println(xy[0] +   + xy[1]);
xy = d.getminmax(3, 3);
System.out.println(xy[0] +   + xy[1]);
xy = d.getminmax(10, 0);
System.out.println(xy[0] +   + xy[1]);
xy = d.getminmax(654, 321);
System.out.println(xy[0] +   + xy[1]);
xy = d.getminmax(100, 193);
System.out.println(xy[0] +   + xy[1]);
}

}


On Fri, May 10, 2013 at 12:33 AM, karthikeyan balamurugan
sbk...@gmail.comwrote:


 Guys i can't understand this problem could any tell's in easy way
 Problem Statement Deer Only has recently shed his antlers. He is now
 ashamed and wants to make fake ones until the real ones grow back.



 Deer Only has found a tree with N vertices. The vertices are numbered 0
 through N-1. You are given two int[]s *a* and *b* that contain N-1
 integers each. These arrays describe the edges of the tree: for each i, the
 vertices *a*[i] and *b*[i] are connected by an edge.



 Deer Only has decided to make his new antlers out of this tree. The only
 operation he is able to do is to remove some edges from his tree, producing
 several smaller trees. Then, he wants to take two of the newly created
 trees and attach them to his head. The two antlers must be isomorphic,
 otherwise he will be unbalanced when running. (See Notes for a formal
 definition of tree isomorphism.)



 Return the maximal size of the deer's new fake antlers. The size of an
 antler is defined as the number of vertices in it. Note that the largest
 possible antlers may sometimes consist only of a single vertex (and no
 edges). Definition Class:DeerInZooDivOneMethod:getmaxParameters:int[],
 int[] Returns:intMethod signature:int getmax(int[] a, int[] b)(be sure
 your method is public)
  Notes -Two trees T1 = (V1, E1) and T2 = (V2, E2) are called isomorphic
 if there exists a bijection f from V1 to V2 with the following property:
 For each pair of vertices in V1 (a, b), there is an edge between a and b in
 T1 if and only if there is an edge between f(a) and f(b) in T2.
 Constraints- N will be between 2 and 51, inclusive.-*a* and *b* will
 contain exactly N-1 elements each. -Each element of *a* and *b* will be
 between 0 and N-1, inclusive.-The edges described by *a* and *b* will
 form a tree.  Examples0)


 {0, 1, 2}

 {1, 2, 3}

 Returns: 2

 The tree looks as follows: 0-1-2-3. Deer Only can remove the edge between
 the vertex 1 and the vertex 2, and he gets two new trees 0-1 and 2-3. These
 two trees are isomorphic, so he can use these two trees as antlers.1)


 {1, 8, 1, 7, 4, 2, 5, 2}

 {5, 3, 6, 8, 2, 6, 8, 0}

 Returns: 4

 The two new trees will contain vertices 0,2,4,6 and 5,8,7,3.2)


 {0}

 {1}

 Returns: 1


 3)


 {0, 11, 10, 10, 19, 17, 6, 17, 19, 10, 10, 11, 9, 9, 14, 2, 13, 11, 6}

 {7, 5, 2, 12, 8, 9, 16, 8, 4, 18, 8, 13, 15, 13, 17, 16, 3, 1, 7}

 Returns: 8


 4)


 {14, 13, 28, 15, 20, 4, 9, 6, 1, 23, 19, 25, 25, 8, 14, 16, 2, 8, 15, 25, 22, 
 22, 28, 10, 10, 14, 24, 27, 8}

 {21, 5, 12, 13, 27, 1, 24, 17, 27, 17, 23, 14, 18, 26, 7, 26, 11, 0, 25, 23, 
 3, 29, 22, 11, 22, 29, 15, 28, 29}

 Returns: 11


 --

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] hai to all

2013-05-11 Thread Leandro Coutinho
ooppsss hehehe
Searched on google to find the link then got the wrong problem hehe.
Thanks for pointing out.


On Sat, May 11, 2013 at 11:07 PM, Carlos Guia carlos.guia.v...@gmail.comwrote:

 I haven't read the editorial, but the OP was talking about the div 1
 version of the problem while you seem to be taking about the div 2 one.
 Based only on the class names provided in the posts.

 Carlos Guia
 On May 11, 2013 9:43 PM, Leandro Coutinho lescoutinh...@gmail.com
 wrote:

 Hello,

 Reading the problem (
 http://community.topcoder.com/stat?c=problem_statementpm=12540rd=15498),
 I think it's like this:

 - Maximum # deer that have two antlers: it's when whenever possible each
 deer lost two antlers:
 q = k / 2, r = k mod 2, max = N - q + r

 - Minimum # deer that have two antlers: it's when whenever possible each
 deer lost just one antler:
 x = N - K, if x = 0, then min = x, else min = 0

 public class DeerInZooDivTwo {


 public int[] getminmax(int N, int K)
 {
 int min = N-K;
 if(min  0) min = 0;
 return new int[]{min, N-((K/2)+(K%2))};
 }

 public static void main(String[] args) {
 DeerInZooDivTwo d = new DeerInZooDivTwo();
 int[] xy = d.getminmax(3, 2);
 System.out.println(xy[0] +   + xy[1]);
 xy = d.getminmax(3, 3);
 System.out.println(xy[0] +   + xy[1]);
 xy = d.getminmax(10, 0);
 System.out.println(xy[0] +   + xy[1]);
 xy = d.getminmax(654, 321);
 System.out.println(xy[0] +   + xy[1]);
 xy = d.getminmax(100, 193);
 System.out.println(xy[0] +   + xy[1]);
 }

 }


  On Fri, May 10, 2013 at 12:33 AM, karthikeyan balamurugan 
 sbk...@gmail.com wrote:


 Guys i can't understand this problem could any tell's in easy way
 Problem Statement Deer Only has recently shed his antlers. He is
 now ashamed and wants to make fake ones until the real ones grow back.



 Deer Only has found a tree with N vertices. The vertices are numbered 0
 through N-1. You are given two int[]s *a* and *b* that contain N-1
 integers each. These arrays describe the edges of the tree: for each i, the
 vertices *a*[i] and *b*[i] are connected by an edge.



 Deer Only has decided to make his new antlers out of this tree. The only
 operation he is able to do is to remove some edges from his tree, producing
 several smaller trees. Then, he wants to take two of the newly created
 trees and attach them to his head. The two antlers must be isomorphic,
 otherwise he will be unbalanced when running. (See Notes for a formal
 definition of tree isomorphism.)



 Return the maximal size of the deer's new fake antlers. The size of an
 antler is defined as the number of vertices in it. Note that the largest
 possible antlers may sometimes consist only of a single vertex (and no
 edges). Definition Class:DeerInZooDivOneMethod:getmaxParameters:int[],
 int[] Returns:intMethod signature:int getmax(int[] a, int[] b)(be sure
 your method is public)
  Notes -Two trees T1 = (V1, E1) and T2 = (V2, E2) are called isomorphic
 if there exists a bijection f from V1 to V2 with the following property:
 For each pair of vertices in V1 (a, b), there is an edge between a and b in
 T1 if and only if there is an edge between f(a) and f(b) in T2.
 Constraints- N will be between 2 and 51, inclusive.-*a* and *b* will
 contain exactly N-1 elements each. -Each element of *a* and *b* will be
 between 0 and N-1, inclusive.-The edges described by *a* and *b* will
 form a tree.  Examples0)


 {0, 1, 2}

 {1, 2, 3}

 Returns: 2

 The tree looks as follows: 0-1-2-3. Deer Only can remove the edge
 between the vertex 1 and the vertex 2, and he gets two new trees 0-1 and
 2-3. These two trees are isomorphic, so he can use these two trees as
 antlers.1)


 {1, 8, 1, 7, 4, 2, 5, 2}

 {5, 3, 6, 8, 2, 6, 8, 0}

 Returns: 4

 The two new trees will contain vertices 0,2,4,6 and 5,8,7,3.2)


 {0}

 {1}

 Returns: 1


 3)


 {0, 11, 10, 10, 19, 17, 6, 17, 19, 10, 10, 11, 9, 9, 14, 2, 13, 11, 6}

 {7, 5, 2, 12, 8, 9, 16, 8, 4, 18, 8, 13, 15, 13, 17, 16, 3, 1, 7}

 Returns: 8


 4)


 {14, 13, 28, 15, 20, 4, 9, 6, 1, 23, 19, 25, 25, 8, 14, 16, 2, 8, 15, 25, 
 22, 22, 28, 10, 10, 14, 24, 27, 8}

 {21, 5, 12, 13, 27, 1, 24, 17, 27, 17, 23, 14, 18, 26, 7, 26, 11, 0, 25, 
 23, 3, 29, 22, 11, 22, 29, 15, 28, 29}

 Returns: 11


 --

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com

Re: [gcj] Re: Commented Source Code together with Contest Analysis

2013-05-06 Thread Leandro Coutinho
Hi bigonion, thanks for sharing your thoughts, but I didn't make this
post to discuss what approach is better. It's a very simple issue.
They already have a solution, because they needed to prove that's
possible to solve the problem, so they could simply attach their
solution to the contest analysis.
Thanks again.

On 5/6/13, bigonion haibren...@gmail.com wrote:
 Agree with Stanislav as well.
 Although it seems counter intuitive, looking at code is NOT helpful. You
 have to understand the analysis before looking at the code, otherwise you
 waste your time. As these codes might have principles which are more
 advanced than simple conditions/loops such as dynamic programming, BFS,
 etc... you must understand the solution first, as these principles are not
 always clear from the code. Also, everyone codes them differently...
 If you learn from the code and not from the principles, you might just
 understand the solution finally, but it will not help you for future tasks.
 And if you understood the principles already, then you should be able to
 code the answer yourself (although it might take a lot of time...),
 otherwise you wouldn't compete in CodeJam.
 I believe the reason for sometimes attaching a Python code is because python
 seems like pseudo-code, which makes it easier for the learning process and
 everyone can understand it even without learning python before. It's not the
 code that matters, it's the pseudo-code and principles! Besides, they only
 do it for really short solutions in which a pseudo-code is really helpful.

 My advice: whenever a long code is attached to a solution, just SKIP it!
 That's the technique that works for me. Learning from the explanations and
 texts is more helpful for future problems.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/Ilrh0wUnxpIJ.
 For more options, visit https://groups.google.com/groups/opt_out.





-- 
[quote:Larry Wall]LazinessImpatienceHubris[/quote]

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Re: Commented Source Code together with Contest Analysis

2013-05-05 Thread Leandro Coutinho
Good points Stanislav! But there's one point here. They already provide
solution sometimes in Python! So they could keep posting solutions in this
language or C++ or Java, cause it's what the majority of people here uses,
and because one that programs in one of these languages is able to
undestand a solution in another. The comments are what is important. I
personally would choose a solution explained for a newbie to understand,
than that bunch of text from Contest Analyse without a solution.
Thank you.
Em 05/05/2013 23:50, Stanislav Zholnin stanislav.zhol...@gmail.com
escreveu:

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gcj] Better samples please

2013-05-04 Thread Leandro Coutinho
The small dataset should test if the coder didn't hard coded the solution.
The large dataset should test if the algorithm is efficient enough.

So if the solution is not hard coded and could solve the sample, it should
be able to solve the small dataset at least.
It's very frustrating when the output is correct for the sample but fails
for the small dataset.
And it's also harder to debug ...

-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Better samples please

2013-05-04 Thread Leandro Coutinho
If the sample had the case below I would be able to solve it. sad ... :'(
InputOutput: 2
11 2
26 28




On Sat, May 4, 2013 at 3:58 PM, Luke Pebody luke.peb...@gmail.com wrote:

 In my humble opinion, Code Jam covers edge cases in their samples much
 much more than Topcoder. In Topcoder, I might have been careless and not
 notice the infinite loop my solution went into in tonight's problem 1 if A
 = 1.

 Whether this is better or worse is a separate debate, but definitely I
 find more coverage in Code Jam than Topcoder.



 On Sat, May 4, 2013 at 7:51 PM, Niraj Kumar niraj.ni...@gmail.com wrote:

 there may be many edge cases which is not covered in sample, but we need
 to take care it.



 Regards,

 *Niraj Kumar*

 B.Tech. CSE
 Class of 2012
 ISM, Dhanbad
 8274952350



 On Sun, May 5, 2013 at 12:11 AM, Leandro Coutinho 
 lescoutinh...@gmail.com wrote:

 The small dataset should test if the coder didn't hard coded the
 solution.
 The large dataset should test if the algorithm is efficient enough.

 So if the solution is not hard coded and could solve the sample, it
 should be able to solve the small dataset at least.
 It's very frustrating when the output is correct for the sample but
 fails for the small dataset.
 And it's also harder to debug ...

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Better samples please

2013-05-04 Thread Leandro Coutinho
When considering removing: min + (motes.length - i - 1)
I just removed -1, then it works.


On Sat, May 4, 2013 at 5:35 PM, porker2008 zhangxion...@gmail.com wrote:

 I don't see why this case is special.

 It is a very general case.

 Parker

 On Sunday, May 5, 2013 4:33:39 AM UTC+8, newbie007 wrote:
  If the sample had the case below I would be able to solve it. sad ... :'(
  InputOutput: 2
 
 
  11 2
  26 28
 
 
 
 
 
 
 
 
  On Sat, May 4, 2013 at 3:58 PM, Luke Pebody luke@gmail.com wrote:
 
 
  In my humble opinion, Code Jam covers edge cases in their samples much
 much more than Topcoder. In Topcoder, I might have been careless and not
 notice the infinite loop my solution went into in tonight's problem 1 if A
 = 1.
 
 
 
 
  Whether this is better or worse is a separate debate, but definitely
 I find more coverage in Code Jam than Topcoder.
 
 
 
 
 
 
 
 
 
 
  On Sat, May 4, 2013 at 7:51 PM, Niraj Kumar niraj...@gmail.com wrote:
 
 
 
  there may be many edge cases which is not covered in sample, but we need
 to take care it.
 
 
 
 
 
 
 
 
 
  Regards,
 
  Niraj Kumar
 
 
 
  B.Tech. CSE
 
 
 
  Class of 2012
  ISM, Dhanbad
  8274952350
 
 
 
 
 
  On Sun, May 5, 2013 at 12:11 AM, Leandro Coutinho lescou...@gmail.com
 wrote:
 
 
 
 
  The small dataset should test if the coder didn't hard coded the
 solution.
  The large dataset should test if the algorithm is efficient enough.
 
 
  So if the solution is not hard coded and could solve the sample, it
 should be able to solve the small dataset at least.
 
 
 
 
  It's very frustrating when the output is correct for the sample but
 fails for the small dataset.
  And it's also harder to debug ...
 
 
 
 
  --
 
  You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 
  To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code...@googlegroups.com.
 
  To post to this group, send email to googl...@googlegroups.com.
 
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 
 
 
 
 
 
 
 
 
 
  --
 
  You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 
  To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code...@googlegroups.com.
 
  To post to this group, send email to googl...@googlegroups.com.
 
  For more options, visit https://groups.google.com/groups/opt_out.
 
 
 
 
 
 
 
 
 
 
 
  --
 
  You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 
  To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code...@googlegroups.com.
 
  To post to this group, send email to googl...@googlegroups.com.
 
  For more options, visit https://groups.google.com/groups/opt_out.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/1vg4v-2sTOwJ.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Re: Bull's Eye - Large

2013-04-28 Thread Leandro Coutinho
Thank you Kannapan. I tested with 1.4 and 1.6 and both worked. 1.0 does't
work.
I also tested the code without the first condition, but it's necessary to
make it work.


On Sat, Apr 27, 2013 at 4:42 PM, Kannappan deshka...@gmail.com wrote:

 the 1.5 might just be to speed up the process to get the value. even if
 1.6 was used or 1.55 was used for that matter, you might still get the
 right answer but with varying speeds. thats just my guess. haven't tried it.


 On Sat, Apr 27, 2013 at 6:04 PM, newbie007 lescoutinh...@gmail.comwrote:

 Hi,

 I understand that they're using binary search, but I don't know how can
 it get to the solution.
 Could someone be very nice and explain the code below, please?
 This is from coder wata:

 void solve() {
 long left = 0, right = 1L  40;
 while (right - left  1) {
 long n = (left + right) / 2;
 if ((double)(2 * r + 1) * n + 2.0 * n * (n - 1)  1.5 *
 t) {
 right = n;
 } else if ((2 * r + 1) * n + 2 * n * (n - 1)  t) {
 right = n;
 } else {
 left = n;
 }
 }
 System.out.println(left);
 }

 Why those values, why 1.5? Man, I don't understand this code :(

 Em sábado, 27 de abril de 2013 05h42min58s UTC-3, Vaibhav Tulsyan
  escreveu:
  I was seeing the solutions of the top 10 contestants for the large
 input of Bull's Eye. They all seem to have used some method involving
 variables like beginning,end and mid. Can anybody explain to me what method
 they've applied exactly?
  I just used basic maths to solve it. They seem to have used some better
 algorithm.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/nB8pI_xLLzAJ.
 For more options, visit https://groups.google.com/groups/opt_out.



  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Re: Bull's Eye - Large

2013-04-28 Thread Leandro Coutinho
Thank you Bas and Samuel.
Thanks a lot Raj and  Álvaro. Now I understand the formula. =)


On Sun, Apr 28, 2013 at 7:08 PM, Leandro Coutinho
lescoutinh...@gmail.comwrote:

 Thank you Kannapan. I tested with 1.4 and 1.6 and both worked. 1.0 does't
 work.
 I also tested the code without the first condition, but it's necessary to
 make it work.


 On Sat, Apr 27, 2013 at 4:42 PM, Kannappan deshka...@gmail.com wrote:

 the 1.5 might just be to speed up the process to get the value. even if
 1.6 was used or 1.55 was used for that matter, you might still get the
 right answer but with varying speeds. thats just my guess. haven't tried it.


 On Sat, Apr 27, 2013 at 6:04 PM, newbie007 lescoutinh...@gmail.comwrote:

 Hi,

 I understand that they're using binary search, but I don't know how can
 it get to the solution.
 Could someone be very nice and explain the code below, please?
 This is from coder wata:

 void solve() {
 long left = 0, right = 1L  40;
 while (right - left  1) {
 long n = (left + right) / 2;
 if ((double)(2 * r + 1) * n + 2.0 * n * (n - 1)  1.5 *
 t) {
 right = n;
 } else if ((2 * r + 1) * n + 2 * n * (n - 1)  t) {
 right = n;
 } else {
 left = n;
 }
 }
 System.out.println(left);
 }

 Why those values, why 1.5? Man, I don't understand this code :(

 Em sábado, 27 de abril de 2013 05h42min58s UTC-3, Vaibhav Tulsyan
  escreveu:
  I was seeing the solutions of the top 10 contestants for the large
 input of Bull's Eye. They all seem to have used some method involving
 variables like beginning,end and mid. Can anybody explain to me what method
 they've applied exactly?
  I just used basic maths to solve it. They seem to have used some
 better algorithm.

 --
 You received this message because you are subscribed to the Google
 Groups Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/nB8pI_xLLzAJ.
 For more options, visit https://groups.google.com/groups/opt_out.



  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.






-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] questions about rounds and structure

2013-04-16 Thread Leandro Coutinho
Can I participate in rounds 2 and 3 if I fail in 1abc? I know that I will
not be able to advance for the subsequent rounds, but it would be cool if I
could at least participate. =D



On Tue, Apr 16, 2013 at 11:32 AM, Carlos Guia carlos.guia.v...@gmail.comwrote:

 Yes you can

 Carlos Guía


 On Tue, Apr 16, 2013 at 10:26 AM, Damian dmore...@gmail.com wrote:

 Can I compete in round 1B if I fail in 1A?
 Similarly, can I compete in 1C if I fail in 1A and 1B?
 Thanks.

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/JF64OeoFHxsJ.
 For more options, visit https://groups.google.com/groups/opt_out.



  --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Re: Round 1A 2012 - Problem B

2013-04-15 Thread Leandro Coutinho
Thanks a lot zach!!! :)


On Mon, Apr 15, 2013 at 10:30 PM, zach polansky
zacharypolan...@gmail.comwrote:

  0 51  4
  0 1 2
  1 1  3
  4 7  6
  5 6 5

 Hope this is understandable

 --
 You received this message because you are subscribed to the Google Groups
 Google Code Jam group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to google-code+unsubscr...@googlegroups.com.
 To post to this group, send email to google-code@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msg/google-code/-/fI17R2_fOYYJ.
 For more options, visit https://groups.google.com/groups/opt_out.




-- 
You received this message because you are subscribed to the Google Groups 
Google Code Jam group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-code+unsubscr...@googlegroups.com.
To post to this group, send email to google-code@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [gcj] Wrong Answer with Problem- The Trip

2011-10-11 Thread Leandro Coutinho
How to submit code to that shit site?

This Java code seems to work, but I don't know how to submit there:
package org.onlinejudge.uva;

import java.io.File;
import java.io.PrintWriter;
import java.util.Scanner;

public class ATheTrip
{
static Scanner in;
static PrintWriter out;

public static void main(String[] args) throws Exception {
in = new Scanner(new File(src/org/onlinejudge/uva/sample.txt));
out = new PrintWriter(new
File(src/org/onlinejudge/uva/sample-output.txt));

int T = in.nextInt();
while(T  0) {
double sum = 0;
double netCost = 0;
double[] costs = new double[T];
for(int i = 0; i  T; i++) {
costs[i] = in.nextDouble();
sum += costs[i];
}
double ma = sum/T;
for(int i = 0; i  T; i++) {
double x = ma - costs[i];
if(x  0) netCost += x;
}

String sNetCost =  + netCost;
int dot = sNetCost.indexOf('.');
String decimalPart = sNetCost.substring(0, dot);
String fractionPart = sNetCost.substring(dot+1,
sNetCost.length()-1);
if(fractionPart.length() == 0) fractionPart = 00;
else fractionPart = fractionPart.substring(0, 2);
out.printf($%s.%s\n, decimalPart, fractionPart);

T = in.nextInt();
}
in.close();
out.close();
}
}


On Mon, Oct 10, 2011 at 9:07 AM, yedtoss yedt...@gmail.com wrote:

 Hi everybody. I am trying to solve the problem id 10137 on UVA online:


 http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=29page=show_problemproblem=1078

 It is asked to give the amount of money exchanged so that every
 student has the same money (within a cent: 0.01)

 Input: n:number of student then n lines each containing the amount in
 dollars and cent spent by a student
 Output: a line stating the total amount of money, in dollars and
 cents, that must be exchanged to equalize the students' costs( within
 a cent).

 Sample  Input:
 4
 15.00
 15.01
 3.00
 3.01

 Sample Output:
 $11.99

 Here is my C++ program

 // START

 #include iostream
 using namespace std;
 long int exec(long int *tab,long int n);
 int main() {
long int n=0;
double *tab;
long int *tab1;
while(1)
{
cinn;
if(n==0)
break;
else
{
tab1=new long int[n];
tab=new double[n];
for(int i=0;in;i++)
{
// take the input as double
// then multiply it by 100
// and convert to long int
cintab[i];
tab1[i]=100*tab[i];
}
// print result
double ans=exec(tab1,n)/100.0;
cout$ansendl;

}

}

return 0;
 }
 // To calculate the total amount exchanged
 // Every amount is multiplied by 100
 long int exec(long int *tab,long int n)
 {
long int sum=0,sum1=0,number1=0,number=0,diff=0;
// The amount(goal) every student will have is the sum of all
// amount divided by the number of students.

for(int i=0;in;i++)
sum+=tab[i];
long int goal=sum/n,goal1=goal;
// If  sum/n is not an integer then the amount could
// also be goal+1
// number is the total number of students who will have
// goal+1
if(sum%n!=0)
{
number=sum-goal*n;
goal1=goal+1;
}
// The total amount exchanged is the (minimal) difference
// between all students costs (so that their cost is high than goal)
// and their new costs((goal+1)*number+goal*(number1-number))
// number1 is the total number of students(H) so that their cost
// are high than goal
// sum1 is the total costs of students H
for(int i=0;in;i++)
{
if(tab[i]goal)
{
sum1+=tab[i];
number1++;

}

}

if(numbernumber1)
diff=number1-number;
if(numbernumber1)
number=number1;
return sum1-(goal1)*number-(goal*diff);



 }
 // END


 But Iam always getting WRONG ANSWER. I don't know where I am wrong.

 Thanks for your help.

 --
 You received this message because you are subscribed to the Google Groups
 google-codejam group.
 To post to this group, send email to google-code@googlegroups.com.
 To unsubscribe from this group, send email to
 google-code+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-code?hl=en.