Questions Tagged With googlehttps://discuss.codechef.com/tags/google/?type=rssquestions tagged <span class="tag">google</span>enMon, 02 Apr 2018 22:32:04 +0530An interview of ACRush with Google Code Jam teamhttps://discuss.codechef.com/questions/7800/an-interview-of-acrush-with-google-code-jam-team<p>ACRush chatting about programming, strategies and more.. here is the <a href="https://plus.google.com/+ResearchatGoogle/posts/ScrRQmGyudT">link</a></p>aichemzeeThu, 28 Mar 2013 14:10:24 +0530https://discuss.codechef.com/questions/7800/an-interview-of-acrush-with-google-code-jam-teamacrushgooglecodejamArithmetic series -Google Interview Questionhttps://discuss.codechef.com/questions/38082/arithmetic-series-google-interview-question<p>Given an array of integers A, give an algorithm to find the longest Arithmetic progression in it, i.e find a sequence i1 < i2 < … < ik, such that A[i1], A[i2], …, A[ik] forms an arithmetic progression, and k is the largest possible length.</p>
<p>The sequence S1, S2, …, Sk is called an arithmetic progression if Sj+1 – Sj is a constant.</p>theshubhamgoelThu, 06 Feb 2014 18:11:18 +0530https://discuss.codechef.com/questions/38082/arithmetic-series-google-interview-questiontrickinterviewgoogleCodeChef Discussionhttps://discuss.codechef.com/questions/22932/codechef-discussion<p>Hello, </p>
<p>Kindly what is the secript that you install it here in
CodeChef Discussion i want to install in on my website : <a href="http://google4ar.net"></a><a href="http://google4ar.net">google4ar.net</a></p>majedatwi11Sat, 31 Aug 2013 18:09:21 +0530https://discuss.codechef.com/questions/22932/codechef-discussionseogoogleHints for puzzle pls: "Don't mind the map"https://discuss.codechef.com/questions/64923/hints-for-puzzle-pls-dont-mind-the-map<p>Need help with the following problem please; don't even know where/how to begin.</p>
<hr>
<p>After the trauma of Dr. Boolean's lab, the rabbits are eager to get back to their normal lives in a well-connected community, where they can visit each other frequently. Fortunately, the rabbits learned something about engineering as part of their escape from the lab. To get around their new warren fast, they built an elaborate subway system to connect their holes. Each station has the same number of outgoing subway lines (outgoing tracks), which are numbered. </p>
<p>Unfortunately, sections of warrens are very similar, so they can't tell where they are in the subway system. Their stations have system maps, but not an indicator showing which station the map is in. Needless to say, rabbits get lost in the subway system often. The rabbits adopted an interesting custom to account for this: Whenever they are lost, they take the subway lines in a particular order, and end up at a known station.</p>
<p>For example, say there were three stations A, B, and C, with two outgoing directions, and the stations were connected as follows</p>
<pre><code>Line 1 from A, goes to B. Line 2 from A goes to C.
Line 1 from B, goes to A. Line 2 from B goes to C.
Line 1 from C, goes to B. Line 2 from C goes to A.
</code></pre>
<p>Now, suppose you are lost at one of the stations A, B, or C. Independent of where you are, if you take line 2, and then line 1, you always end up at station B. Having a path that takes everyone to the same place is called a meeting path.</p>
<p>We are interested in finding a meeting path which consists of a fixed set of instructions like, 'take line 1, then line 2,' etc. It is possible that you might visit a station multiple times. It is also possible that such a path might not exist. However, subway stations periodically close for maintenance. If a station is closed, then the paths that would normally go to that station, go to the next station in the same direction. As a special case, if the track still goes to the closed station after that rule, then it comes back to the originating station. Closing a station might allow for a meeting path where previously none existed. That is, if you have</p>
<pre><code>A -> B -> C
</code></pre>
<p>and station B closes, then you'll have</p>
<pre><code>A -> C
</code></pre>
<p>Alternately, if it was</p>
<pre><code>A -> B -> B
</code></pre>
<p>then closing station B yields</p>
<pre><code>A -> A
</code></pre>
<p>Write a function answer(subway) that returns one of:</p>
<pre><code>-1 (minus one): If there is a meeting path without closing a station
The least index of the station to close that allows for a meeting path or
-2 (minus two): If even with closing 1 station, there is no meeting path.
subway will be a list of lists of integers such that subway[station][direction] = destination_station.
</code></pre>
<p>That is, the subway stations are numbered 0, 1, 2, and so on. The k^th element of subway (counting from 0) will give the list of stations directly reachable from station k.</p>
<p>The outgoing lines are numbered 0, 1, 2... The r^th element of the list for station k, gives the number of the station directly reachable by taking line r from station k.</p>
<p>Each element of subway will have the same number of elements (so, each station has the same number of outgoing lines), which will be between 1 and 5.</p>
<p>There will be at least 1 and no more than 50 stations.</p>
<p>For example, if
subway = [[2, 1], [2, 0], [3, 1], [1, 0]]
Then one could take the path [1, 0]. That is, from the starting station, take the second direction, then the first. If the first direction was the red line, and the second was the green line, you could phrase this as:
if you are lost, take the green line for 1 stop, then the red line for 1 stop.
So, consider following the directions starting at each station.</p>
<pre><code>0 -> 1 -> 2.
1 -> 0 -> 2.
2 -> 1 -> 2.
3 -> 0 -> 2.
</code></pre>
<p>So, no matter the starting station, the path leads to station 2. Thus, for this subway, answer should return -1.</p>
<p>If</p>
<pre><code>subway = [[1], [0]]
</code></pre>
<p>then no matter what path you take, you will always be at a different station than if you started elsewhere. If station 0 closed, that would leave you with</p>
<pre><code>subway = [[0]]
</code></pre>
<p>So, in this case, answer would return 0 because there is no meeting path until you close station 0.</p>
<p>To illustrate closing stations,</p>
<pre><code>subway = [[1,1],[2,2],[0,2]]
</code></pre>
<p>If station 2 is closed, then
station 1 direction 0 will follow station 2 direction 0 to station 0, which will then be its new destination.
station 1 direction 1 will follow station 2 direction 1 to station 2, but that station is closed, so it will get routed back to station 1, which will be its new destination. This yields</p>
<pre><code>subway = [[1,1],[0,1]]
</code></pre>
<h1>Test cases</h1>
<p>Inputs:
(int) subway = [[2, 1], [2, 0], [3, 1], [1, 0]]
Output:
(int) -1</p>
<p>Inputs:
(int) subway = [[1, 2], [1, 1], [2, 2]]
Output:
(int) 1</p>yleeweiThu, 19 Feb 2015 13:46:51 +0530https://discuss.codechef.com/questions/64923/hints-for-puzzle-pls-dont-mind-the-mappythonchallengegooglejavaalgorithmIf I solve a question in long challenge will Google hire me ???https://discuss.codechef.com/questions/67590/if-i-solve-a-question-in-long-challenge-will-google-hire-me<p>Will it really hire me ?</p>shivamkantivalThu, 09 Apr 2015 23:13:19 +0530https://discuss.codechef.com/questions/67590/if-i-solve-a-question-in-long-challenge-will-google-hire-megoogleGoogle Code Jam 2015, Round 1https://discuss.codechef.com/questions/67772/google-code-jam-2015-round-1<p>Hello everyone, this is my first time at Google Code Jam, and I would be grateful if someone tells me how many points will be required to clear round 1, and also some general tips and/or advise.</p>shiva1k95_10Mon, 13 Apr 2015 23:36:39 +0530https://discuss.codechef.com/questions/67772/google-code-jam-2015-round-1tipsgooglecodejamgeneralhow to solve noisy neighbour from codejam?https://discuss.codechef.com/questions/68543/how-to-solve-noisy-neighbour-from-codejam<p>please can anybody give me the approach to solve <a href="https://code.google.com/codejam/contest/8224486/dashboard#s=p1">Noisy Neighbours</a> problem from codejam round 1B?</p>sh1p23Sun, 03 May 2015 02:38:50 +0530https://discuss.codechef.com/questions/68543/how-to-solve-noisy-neighbour-from-codejamgooglecodejamHow to Google+ +1 CodeChef Problemhttps://discuss.codechef.com/questions/75728/how-to-google-1-codechef-problem<p>I recently +1ed <a href="https://www.codechef.com/rankings/OCT15">the OCT15 Rankings</a> and made a post about the current CodeChef Long competition using the <code>G+1</code> button in the top-left corner. I remember this used to be on problem statements, too. However, when I go to a problem statement now (here's an <a href="https://www.codechef.com/OCT15/problems/SUBINC">example</a>), I can't find the <code>G+1</code> button. I can easily make a Google+ post manually and include the link to the problem, but I am curious about how I can make a Google+ post about a problem from the CodeChef Web site like with the rankings. Thank you for looking at this, CodeChef!</p>noble_mushtakSun, 04 Oct 2015 03:40:39 +0530https://discuss.codechef.com/questions/75728/how-to-google-1-codechef-problemgooglecodechefGoogle APAC Test 2016 Problemhttps://discuss.codechef.com/questions/76228/google-apac-test-2016-problem<p>There was a problem in Google APAC Test 2016 Round C (Problem B) — gFiles (<a href="https://code.google.com/codejam/contest/4284487/dashboard#s=p1">https://code.google.com/codejam/contest/4284487/dashboard#s=p1</a> — Google Login may be required).</p>
<p>The approach that I came up with which ran successfully on the sample cases was:</p>
<pre><code>Find the lower bound and upper bound on the number of elements (because for a particular value of k[i] and p[i] only a handful of values of total files are possible which lie between lower_bound and upper_bound).
To find these bound, iterate over the entry i (p[i] and k[i]) and do
Iterate over array
if(p[i] != 0 && k[i] != 0)
lower_bound = max(lower_bound, ceil((k[i]*100.0)/(p[i]+0.9999999))
upper_bound = min(upper_bound, floor((k[i]*100.0)/(p[i]))
else if(p[i] == 0 && k[i] != 0)
lower_bound = max(lower_bound, ceil((k[i]*100.0)/(p[i]+0.9999999))
End of Iteration
If lower_bound == upper_bound
answer = lower_bound
else
answer = -1
</code></pre>
<p>Even after considering a special case ( checking P[i] for 100 in the iteration and modifying the lower_bound and upper_bound according to it i.e setting both of these to K[i] ), I am not getting the correct output. </p>
<p>While giving the correct outputs for the sample cases, it failed on system test on small inputs.</p>
<p>Can anyone give a hint on where was the fault in my approach ?</p>abhiosharMon, 19 Oct 2015 00:59:04 +0530https://discuss.codechef.com/questions/76228/google-apac-test-2016-problembinary-searchgoogledata-structurealgorithmslogicmathsCodeJam Practicehttps://discuss.codechef.com/questions/87601/codejam-practice<p>Question link : <a href="https://code.google.com/codejam/contest/4304486/dashboard">https://code.google.com/codejam/contest/4304486/dashboard</a></p>
<p>Somebody please explain me what they mean by in the problem statement</p>
<p>' The contestant wins the game if their last word is the last of an alphabetically sorted list of all of the possible last words that could have been produced. '</p>
<p>Explain it with the example of a testcase from the problem itself.
Thanks in advance.
:)</p>rdrsadhuTue, 15 Nov 2016 09:43:34 +0530https://discuss.codechef.com/questions/87601/codejam-practiceguidancepracticegooglehelpcodejamComputing Olympiad Problems,Data Structures & Algorithms Discussion Grouphttps://discuss.codechef.com/questions/86832/computing-olympiad-problemsdata-structures-algorithms-discussion-group<p>I have created A Google Group Called <a href="https://groups.google.com/forum/#!forum/junior-programmers-group">Junior Programmers Group</a> where all school students from Grade 7(or below) to Grade 12 can discuss Problems from ZIO,ZCO,INOI,IOITC,IOI & other Computing Olympiads Problems including Data Structures & Algorithms</p>coder_voderSun, 30 Oct 2016 18:05:08 +0530https://discuss.codechef.com/questions/86832/computing-olympiad-problemsdata-structures-algorithms-discussion-groupgoogleGoogle Apac 2017 : Problem Dhttps://discuss.codechef.com/questions/83326/google-apac-2017-problem-d<p>Can anyone tell the approach for large dataset <a href="https://code.google.com/codejam/contest/11274486/dashboard#s=p3">Google APAC Problem:D</a> </p>
<p>i.e.</p>
<pre><code>1 ≤ M ≤ 1,000,000,000.
8 ≤ N ≤ 12.
1 ≤ Ai,j ≤ 1,000,000,000.
1 ≤ Ci,j ≤ 1,000,000,000.
</code></pre>
<p>For small dataset it is a simple DP but no clue about large datasets .</p>rajan_parmarMon, 18 Jul 2016 13:42:52 +0530https://discuss.codechef.com/questions/83326/google-apac-2017-problem-ddynamic-programmingapac-2017googleProficiency needed in terms of Codechef rating to get into companies like Google?https://discuss.codechef.com/questions/109676/proficiency-needed-in-terms-of-codechef-rating-to-get-into-companies-like-google<p>What would be the approximate skill level in terms of rating needed to clear Algorithm rounds at companies like Google/MS/Amazon? (Assuming rating indicates skill level)</p>simhaSun, 27 Aug 2017 02:38:09 +0530https://discuss.codechef.com/questions/109676/proficiency-needed-in-terms-of-codechef-rating-to-get-into-companies-like-googleratingsgooglemicrosoftcodechefGoogle Code jam kickStart Problem A : Huge Numberhttps://discuss.codechef.com/questions/115121/google-code-jam-kickstart-problem-a-huge-number<p><a href="https://code.google.com/codejam/contest/3254486/dashboard">Problem Link</a></p>
<p>Can any one please tell it is giving wrong answer but it is working for sample test case
My Solution</p>
<pre><code>/*
</code></pre>
<h6>###### ##### ###### ######</h6>
<p># # # # # # # # # #
# # # # # # # ## # # ## # #
# # # # # # # # # # #</p>
<h6># # # # # # # # #</h6>
<p><em>/
import java.util.</em>;
import java.lang.<em>;
import <a href="http://java.io">java.io</a>.</em>;
import java.math.*;
class hugenumber {
public static void main(String args[] ) throws Exception {
Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(<a href="http://System.in">System.in</a>)));
PrintStream p = System.out;
int t =scan.nextInt();
int i=1;
while(t-->0){</p>
<pre><code> int a =scan.nextInt();
int n =scan.nextInt();
int d =scan.nextInt();
BigInteger fact = factorial(n);
BigInteger bi1 = new BigInteger(Integer.toString(a));
BigInteger bi2 = new BigInteger(Integer.toString(d));
BigInteger bi3 = bi1.modPow(fact, bi2);
p.println("Case #" + i + ": " +bi3);
i++;
}
}
static BigInteger factorial(int n){
BigInteger fact= BigInteger.ONE;
int factorialNo = 100;
for (int i = 2; i <= factorialNo; i++){
fact = fact.multiply(new BigInteger(String.valueOf(i)));
}
return fact;
}
</code></pre>
<p>}</p>drjaatSun, 22 Oct 2017 13:32:48 +0530https://discuss.codechef.com/questions/115121/google-code-jam-kickstart-problem-a-huge-numberproblemgooglecodejamLast Few Days : Register for Google Code Jam 2018https://discuss.codechef.com/questions/125242/last-few-days-register-for-google-code-jam-2018<p>Hello community,</p>
<p>I would like to share this important info via this awesome platform.</p>
<p>Every year Google Code Jam calls on programmers around the world to put their skills to the test by solving multiple rounds of algorithmic puzzles. The online rounds conclude in the World Finals, which rotates globally. In addition to being challenging and fun, Code Jam problems can help you develop your coding and programming skills.</p>
<p>It's is great opportunity for the Indian Programmers to compete, and gain substantial experience for the future.Actually last year I missed the competition due to lack of awareness. Hope if you haven't registered yet this post will help you for sure.</p>
<p>REGISTRATION LINK :<a href="https://codejam.withgoogle.com/2018/">https://codejam.withgoogle.com/2018/</a></p>
<p>You can check out the schedule here :<a href="https://code.google.com/codejam/schedule">https://code.google.com/codejam/schedule</a>
Official Site link :<a href="https://code.google.com/codejam/">https://code.google.com/codejam/</a></p>
<p>The platform is bit change relative to last year.You can check the comments in the given
link :<a href="http://codeforces.com/blog/entry/58647">http://codeforces.com/blog/entry/58647</a> </p>
<p><strong><em>All of you are invited in this discussion, to actively participate and share and learn !</em></strong></p>
<p>All the best to all the participants participating this year!</p>
<p>Happy Coding!</p>ayushgupta1997Mon, 02 Apr 2018 22:32:04 +0530https://discuss.codechef.com/questions/125242/last-few-days-register-for-google-code-jam-2018schedulegoogle2018codejamregistration