The Way to a Friends House Is Never Too Long problem using qsort() function.
#include <stdio.h> #include <math.h> #include <stdlib.h> #define gc getchar_unlocked #define distance_formula sqrt((pow((y2-y1),2)+pow((x2-x1),2))); int compare(void const *,void...
View ArticleSPIT1 - Editorial
PROBLEM LINK:PracticeContestAuthor:Vikesh TiwariEditorialist:Vikesh TiwariDIFFICULTY: Simple PREREQUISITES: maps,Hashing, Implementation PROBLEM There are N rounds and there are many participants. In...
View ArticlePrinting general equation of circle by C programming
Given x,y coordinates of 3 points, I have to tell that is it possible to draw a circle. If so, what is the equation of the circle in this format: x^2 + y^2 + 2gx + 2fy + c = 0Note that I am programming...
View ArticleClock on home page
Not related to programming: Why the clock on home page, besides "Upcoming Contest" is not a real clock? Its really irritating and annoying to see it not work. Make it work. Just a request, although its...
View ArticleTAPAIR - Editorial
PROBLEM LINK:PracticeContestAuthor:Tuan Anh Tran DangTester:Gerald AgapovEditorialist:Jingbo ShangDIFFICULTY:HardPREREQUISITES:DFS orderPROBLEM:Given an undirected simple graph with N nodes and M...
View ArticlePLZLYKME - Editorial
PROBLEM LINK:PracticeContestAuthor:Kaushik IskaTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:SimplePREREQUISITES:Programming LanguagePROBLEM:Define F[1] = S, F[i > 0] = F[i - 1] * (C + 1)....
View ArticleMTRICK - Editorial
PROBLEM LINK:PracticeContestAuthor:Nikhil GargTester:Gerald AgapovEditorialist:Jingbo ShangDIFFICULTY:Easy-MediumPREREQUISITES:Programming Language, Simple Math.PROBLEM:Perform the "Ancient Algorithm"...
View ArticleFGFS - Editorial
PROBLEM LINK:PracticeContestAuthor:Vivek HamirwasiaTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:EasyPREREQUISITES:Sort, Greedy.PROBLEM:Given some sets of open intervals (exclusive at two ends), for...
View ArticleERROR - Editorial
PROBLEM LINK:PracticeContestAuthor:Vivek HamirwasiaTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:CakewalkPREREQUISITES:Programming Language.PROBLEM:Determine whether the given binary string contains...
View ArticleSEAGRP - Editorial
PROBLEM LINK:PracticeContestAuthor:Sergey NaginTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Matching, Gaussian EliminationPROBLEM:Determine whether there is any perfect...
View ArticleLife,The universe and everything
What is wrong with the following code. It shows wrong answer in codechef.include <stdio.h>include <stdlib.h>int main() { int a;while(a!=42) { scanf("%d",&a);...
View ArticleMETEORAK - Editorial
PROBLEM LINK:PracticeContestAuthor:Roman RubanenkoTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Dynamic ProgrammingPROBLEM:Given a N * M matrix mat with some obstacles inside,...
View ArticleFRBSUM - Editorial
PROBLEM LINK:PracticeContestAuthor:Constantine SokolTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:MediumPREREQUISITES:Segment Tree, Binary Search, Persistent Segment Tree.PROBLEM:Given A[1..N], and...
View ArticleCNTDSETS - Editorial
PROBLEM LINK:PracticeContestAuthor:Mugurel Ionut AndreicaTester:MahbubEditorialist:Jingbo ShangDIFFICULTY:HardPREREQUISITES:Combination, Inclusion–exclusion principle, Euler's theoremPROBLEM:Find out...
View ArticleTOURBUS - Editorial
PROBLEM LINK:PracticeContestAuthor:David StolpTester:Gerald AgapovEditorialist:Jingbo ShangDIFFICULTY:ChallengePREREQUISITES:Greedy, Dynamic Programming, Search, RandomPROBLEM:Given a undirected graph...
View Article[Coder's Calendar] Firefox and Chrome extension for Competitive Programming
Hi all, We all know how difficult it is to be aware of the different coding competitions taking place on various platforms,so I've made an add-on(extension) both in chrome and firefox to make this task...
View ArticleHow can I learn most of algorithms used in CodeChef contests?
I wish to know and learn most of the algorithms used in contests in codechef to optimize and reduce time of my codes
View ArticlePrime Generator Problem
I am trying to solve Prime Generator problem and using the sieve of erasthones Algorithm to finding the prime number between two number of large range (m and n (1 <= m <= n <= 1000000000,...
View ArticleHow can a beginner learn programming?
What can a beginner do to master the art of programming?? If one knows the basics but does not possess the skills yet what must he do???
View ArticleWhere have I made mistake?
Can anyone point out my mistake? I am getting WA for first test case of the sample test cases.problemMy code
View Article