Competitive Programming is all about “Given well-known Computer Science (CS) problems, solve them as quickly as possible! “.
Type Code Faster.
Quickly Identify Problem Types.
Do Algorithm Analysis.
Master Programming Languages.
Master the Art of Testing Code.
diff
in Unix to check for difference in i/o.Practice and More Practice.
Background Story/problem description
I/O Description.
Samples for I/O.
# of Test Cases Based i/o
int TC,a,b;
scanf("%d",&TC);
while(TC--){
scanf("%d %d",&a,&b);
printf("%d\n",a+b);
}
Variable # of i/o
int k, ans v;
while (scanf("%d",&k) != EOF){
ans=0;
while(k--){ scanf("%d",&v); ans +=v}
printf("%d\n", ans);
}
These are simply problems that can’t be classified anywhere easily.
But a broad categorization is:
UVa 11172 - Relational Operators * (ad hoc, very easy, one liner)
UVa 11498 - Division of Nlogonia * (just use if-else statements)
UVa 11727 - Cost Cutting * (sort the 3 numbers and get the median)
UVa 10114 - Loansome Car Buyer * (just simulate the process)
UVa 11559 - Event Planning * (one linear pass)
UVa 11799 - Horror Dash * (one linear scan to find the max value)
UVa 00573 - The Snail * (simulation, beware of boundary cases!)
UVa 10141 - Request for Proposal * (solvable with one linear scan)
UVa 11507 - Bender B. Rodriguez … * (simulation, if-else)
UVa 00462 - Bridge Hand Evaluator (simulation; card)
UVa 10646 - What is the Card? (shuffle cards with some rule and then get certain card)
UVa 12247 - Jollo (interesting card game; simple, but requires good logic to get all test cases correct)
UVa 00278 - Chess (ad hoc, chess, closed form formula exists)
UVa 00696 - How Many Knights (ad hoc, chess)
UVa 10284 - Chessboard in FEN (FEN = Forsyth-Edwards Notation is a standard notation for describing board positions in a chess game)
UVa 00156 - Ananagram (easier with algorithm::sort)
UVa 00195 - Anagram (easier with algorithm::next permutation)
UVa 00454 - Anagrams (anagram)
UVa 00401 - Palindromes (simple palindrome check)
UVa 10945 - Mother Bear (palindrome)
UVa 11221 - Magic Square Palindrome (we deal with a matrix)
UVa 00579 - Clock Hands (ad hoc, time)
UVa 00893 - Y3K (use Java Gregorian Calendar; similar to UVa 11356)
UVa 11947 - Cancer or Scorpio (easier with Java Gregorian Calendar)