1 | 0x00h | 679 pts |
2 | boris39 | 679 pts |
3 | thefinder | 679 pts |
4 | neoxquick | 660 pts |
5 | maf-ia | 642 pts |
6 | eax | 641 pts |
7 | Lucky92 | 640 pts |
8 | nikokks | 599 pts |
9 | benito255 | 589 pts |
10 | mego | 573 pts |
11 | madbat2 | 563 pts |
12 | plucth | 546 pts |
13 | Mart | 535 pts |
14 | rostale | 533 pts |
15 | LouisJ | 521 pts |
16 | Stupefy | 514 pts |
17 | lalba | 514 pts |
18 | tehron | 499 pts |
19 | Kithyane | 483 pts |
20 | egosum | 458 pts |
Salut nikokks Ce problème n'est pas évident en effet. Une manière de faire est de trouver les formes les plus simples, et de les "effacer" de l'image avant de chercher les formes plus complexes ;)
Salut a tous =) , je bug sur le problème 28 (forme analysis). Quelqu'un aurait il une piste ?
Coucou oui, tu peux m'envoyer un mail si tu veux. Le plus simple, ce serait d'avoir un package pour python 3. J'ai essayé et ça n'a pas marché!
Salut thefinder, ça faisait longtemps ! Oula ça en fait des problèmes :'( Le premier challenge ? La somme de deux nombres ?
Coucou, j'ai essayé de reprendre avec python. J'ai plusieurs soucis. 1) Il faut rajouter headers={'Content-Type': 'application/x-www-form-urlencoded'} avec un requests.session(). 2) Je n'ai pas réponse du serveur si je soumet une réponse au premier challenge. J'essaye finir en python les 3 dernières épreuves qui me reste. :)
Bonjour, un léger problème sur l'épreuve 10 : Une fois réussie, le champ "points earned" indique 72 au lieu de 7 En revanche sur le site le nombre de points comptabilisés est bien 7 Merci pour ce site génial !
Équation du challenge 52 corrigée, merci
Bonjour, il y a aussi un problème d'affichage "invalid equation" dans le challenge 52. Merci
Barbapapou l'équation du challenge 29 a été corrigée
Bonjour, il y a un problème avec l'affichage d'une équation dans le challenge 29
![]() |
Vous aimez µContest ? |
µContest, what is it ? How to participate ? How to solve the challenges proposed ? What language ? You will find all the answers to theses questions in this page. Concerning more specific questions, you can ask them on the forum.
GeneralHow to solve a challengeThe µContest libraries |
Example of a challenge resolution I
Example of a challenge resolution II |
Technical documentations
|
In this example, we are going to solve a simple challenge about strings. This is Ave Caesar I.
As you can see on the page of the challenge, the ID is 4, we are going to use this piece of information in the code in order to solve it.
This example is aimed at showing how to handle strings with the libraries.
Let's see what the solutions look like in C/C++, Java and Python.
This ID (4) is used at this line :
ErrorCode = MC_StartContest(4, "Your nickname", "Your password");Solution :
#include "microcontest2.h" #include <stdio.h> int main() { /************************************************************************/ /*********************VARIABLES DECLARATIONS*****************************/ /************************************************************************/ MC_ResultStruct Res; // Structure that will be filled with the results information unsigned int ErrorCode; int LibUpToDate; char *pCryptedText = NULL; // Variables related to the unsigned int CryptedTextLength = 0; // contest. char *pPlainText = NULL; int Key = 0; unsigned int c = 0; /************************************************************************/ /*************CHECKING IF THE LIB MICROCONTEST IS UP TO DATE*************/ /************************************************************************/ ErrorCode = MC_CheckLibVersion(&LibUpToDate); // Check if the lib microcontest is up to date if(ErrorCode != MC_OK) { MC_ErrorMessage(ErrorCode, 1); // This function prints the message of the error. return 0; } else if(LibUpToDate == 0) { printf("Warning: the version of the libmicrocontest2 is not the last one.\n"); printf("Current version:\t%s\n", MC_LIBVERSION); printf("This program may not work properly. Consider downloading the latest version on\nthis page : http://www.microcontest.com/download.php\n\n"); } /************************************************************************/ /*****CONNECTING TO THE CHALLENGE AND GETTING THE VARIABLES VALUES*******/ /************************************************************************/ ErrorCode = MC_StartContest(4, "Your nickname", "Your password"); // Call this function to make the library get the variables values of a challenge. if(ErrorCode != MC_OK) { MC_ErrorMessage(ErrorCode, 1); return 0; } ErrorCode = MC_GetParam_char("txt_crypte", &pCryptedText, &CryptedTextLength); // Get the variables values. Depending on the contest, you can get int, ErrorCode *= MC_GetParam_int("key", &Key); // float, or string values thanks to the functions MC_GetParam_xxx. if(ErrorCode == 0) { printf("Impossible to get the contest data. Please check the ID of the contest.\n"); return 0; } /************************************************************************/ /*********************SOLVING THE CHALLENGE******************************/ /************************************************************************/ pPlainText = (char *)malloc((CryptedTextLength + 1)*sizeof(char)); // Solve the contest itself here if(pPlainText == NULL) { printf("Error, impossible to allocate the memory for pPlainText\n"); return 0; } else pPlainText[CryptedTextLength] = 0; for(c = 0; c < CryptedTextLength; c++) { pPlainText[c] = pCryptedText[c] - Key; if(pPlainText[c] < 65) pPlainText[c] += 26; } printf("Crypted text :\t%s\n", pCryptedText); printf("Key :\t\t%d\n", Key); printf("Plain text:\t%s\n\n", pPlainText); /************************************************************************/ /*SENDING THE SOLUTION TO THE SERVER AND PRINTING THE RESULT INFORMATION*/ /************************************************************************/ MC_AddVariableToSolution_char("txt_clair", pPlainText, strlen(pPlainText)); // Add the variable to the solution. You can add several depending on // the contest free(pPlainText); ErrorCode = MC_SendSolution(&Res); // Send the solution to the server if(ErrorCode != MC_OK) MC_ErrorMessage(ErrorCode, 1); MC_ResultMessage(&Res, 1); // This function prints a summary of the results return 0; }
This ID (4) is used at this line :
cont = commence_contest(4, "Your nickname", "Your password")Solution :
# -*- coding: utf-8 -*- from libmicrocontest2_python27 import * if not check_version(): print "Warning: the version of the libmicrocontest2 is not the last one." print "Current version :\t" + get_currentversion() print "This program may not work properly. Consider downloading the latest version on\nthis page : http://www.microcontest.com/download.php\n" cont = commence_contest(4, "Your nickname", "Your password") # short form uses username, password from credentials.py # cont = commence_contest(1) CryptedText = cont.get_str('txt_crypte') Key = cont.get_int('key') PlainText = '' for c in CryptedText: NewChar = ord(c) - Key if NewChar < 65: NewChar += 26 PlainText += chr(NewChar) print 'CryptedText:\t' + CryptedText print 'Key:\t\t' + str(Key) print 'PlainText:\t' + PlainText cont.append_answer("txt_clair", PlainText) print(cont.submit_answer())
This ID (4) is used at this line :
Contest cont = Contest.commenceContest(4, "Your nickname", "Your password");Solution :
import com.microcontest.Libmicrocontest2; import com.microcontest.Contest; public class Contest4 { public static void main(String[] args) { if(Libmicrocontest2.checkVersion() == false) { System.out.println("Warning: the version of the libmicrocontest2 is not the last one."); System.out.println("Current version :\t" + Libmicrocontest2.VERSION); System.out.println("This program may not work properly. Consider downloading the latest version on this page : http://www.microcontest.com/download.php\n"); } Contest cont = Contest.commenceContest(4, "Your nickname", "Your password"); // Contest cont = Contest.commenceContest(4); if you use credentials int key = cont.getInt("key"); String txt_crypted = cont.getParam("txt_crypte"); char[] txt_plain = new char[txt_crypted.length()]; for(int c = 0; c < txt_crypted.length(); c++) { txt_plain[c] = (char)(txt_crypted.charAt(c) - key); if(txt_plain[c] < 65) txt_plain[c] += 26; } System.out.println("Crypted text :\t" + txt_crypted); System.out.println("Key :\t\t" + key); System.out.println("Plain text :\t" + String.valueOf(txt_plain)); cont.appendAnswer("txt_clair", String.valueOf(txt_plain)); System.out.println(cont.submitAnswer()); } }
This ID (4) is used at this line :
$contest->startContest(4, 'Your nickname', 'Your password');Solution :
<?php // We include the µContest library require 'libmicrocontest2.php'; $contest = new uContest(); // We check if the µContest library is up to date if($contest->checkVersion() == 0) { echo 'Warning: the version of the libmicrocontest2 is not the last one.<br />'; echo 'Current version : ' . $contest->version . '<br />'; echo 'This program may not work properly. Consider downloading the latest version on this page : http://www.microcontest.com/download.php<br /><br />'; } // We connect to the challenge try { $contest->startContest(4, 'Your nickname', 'Your password'); } catch (Exception $ex) { echo $ex->getMessage(); exit(); } // We get the variables of the challenge $key = intval($contest->getParam('key')); $cryptedText = $contest->getParam('txt_crypte'); // We solve the challenge itself $plainText = ''; foreach(str_split($cryptedText) as $c) { $newChar = ord($c) - $key; if($newChar < 65) $newChar += 26; $plainText .= chr($newChar); } echo "key = $key<br />"; echo "cryptedText = $cryptedText<br />"; echo "plainText = $plainText<br /><br />"; // We add the answer to the answer to be sent. You can add several answers, depending on the challenge $contest->appendAnswer('txt_clair', $plainText); // We send the answer(s) and print the result try { $result = $contest->sendAnswer(); } catch (Exception $ex) { echo $ex->getMessage(); exit(); } print_r($result); ?>
Of course, it is possible to solve the challenges in any other language. But for that, you must develop your own functions of communication with the webiste.
You can take a look at the source code of our libraries to help yourself.
The mecanisms of communication are described on the page Interface.