C++ De La Vida

Programming with Style

By

MO’s Algorithm

Una vez más encontré un tema que es útil, interesante pero tiene menos recursos en línea. Antes de escribir esto hice una pequeña encuesta y me sorprendió que casi ninguno de los programadores cubanos conociera este algoritmo. Es importante aprender esto, todos los programadores rojos en codeforces utilizar esto con eficacia en la división 1 C y D problemas. No hubo ningún problema en esto un año y medio atrás, pero desde entonces hay un punto para arriba! Podemos esperar más problemas en esto en competiciones futuras.

By

Heavy Light Decomposition

What kind of problems can be solved using the heavy light decomposition technique?

graph

Please read this good article for better reference.
Read More

By

Dos equipos cubanos a final mundial ACM ICPC

Felicidades para UH_REFRESH y Conquer & Divide por la clasificación para la Final Mundial No. 40 del ACM-ICPC en Tailandia.

By

The COJ Progressive Contest #8

Hello users!

We are glad to invite you to take part in the 8th Edition of the COJ Progressive Contest. The problems for all levels are from UTP Open 2015 divisions 1 and 2, programming contests of Universidad Tecnológica de Pereira (UTP) in Colombia hosted by the Red de Programación Competitiva (RPC), which took place on 2015. Although were added some problems to each level, from sources like 2015 Cuban Informatics Olympiad and typical Caribbean ProblemSetters.

The contest duration is 10 days (from 2015-06-05 15:00:00 to 2015-06-15 15:00:00). The tasks are in English. The allowed programming languages are C, C++, C++11, C#, Java, Perl, PHP, Bash, Ruby, Pascal and Python. The contest will be held on the rules for progressive competitions in the COJ. If you have any question, please feel free to ask on coj@uci.cu

You need to have an account in the Caribbean Online Judge (COJ – http://coj.uci.cu/user/createnewaccount.xhtml). You don’t need to register in the contest – the registration in the contest is effective with the first submission.

Read More

By

Cantidad de Dígitos

Español / Spanish

Solo tienes que responder los siguiente:
Cuantos dígitos tiene  N = 4 ^ 411 * 5 ^ 815?
En tu comentario solo escribes la cantidad de dígitos que tiene N. Ej. 20.
Muy sencillo verdad…

Inglés / English

Just answer the following:
How many digits has N = 4 ^ 411 * 5 ^ 815?
In your comment just write the number of digits that must N. Ex. 20.
Very simple really …

Responder / Answer

By

Using Tries

There are many algorithms and data structures to index and search strings inside a text, some of them are included in the standard libraries, but not all of them; the trie data structure is a good example of one that isn’t.

Let word be a single string and let dictionary be a large set of words. If we have a dictionary, and we need to know if a single word is inside of the dictionary the tries are a data structure that can help us. But you may be asking yourself, “Why use tries if set <string> and hash tables can do the same?” There are two main reasons:

Read More

By

Using Regular Expressions

A regular expression is a special string that describes a search pattern. Many of you have surely seen and used them already when typing expressions like ls(or dir) *.txt , to get a list of all the files with the extension txt. Regular expressions are very useful not only for pattern matching, but also for manipulating text. In SRMs regular expressions can be extremely handy. Many problems that require some coding can be written using regular expressions on a few lines, making your life much easier.

Read More

By

Prime Numbers, Factorization and Euler Function

Prime numbers and their properties were extensively studied by the ancient Greek mathematicians. Thousands of years later, we commonly use the different properties of integers that they discovered to solve problems. In this article we’ll review some definitions, well-known theorems, and number properties, and look at some problems associated with them.

Read More

By

Introduction to String Searching Algorithms

Rabin-Karp and Knuth-Morris-Pratt Algorithms

The fundamental string searching (matching) problem is defined as follows: given two strings – a text and a pattern, determine whether the pattern appears in the text. The problem is also known as “the needle in a haystack problem.”

Read More

By

Algorithm Games

algorithmGames_02The games we will talk about are two-person games with perfect information, no chance moves, and a win-or-lose outcome. In these games, players usually alternate moves until they reach a terminal position. After that, one player is declared the winner and the other the loser. Most card games don’t fit this category, for example, because we do not have information about what cards our opponent has.

First we will look at the basic division of positions to winning and losing. After that we will master the most important game — the Game of Nim — and see how understanding it will help us to play composite games. We will not be able to play many of the games without decomposing them to smaller parts (sub-games), pre-computing some values for them, and then obtaining the result by combining these values.

Read More