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
|
Current version : 2.1
The library contains functions that enable you
#include "microcontest2.h"
Here is a list of the functions you can use :
Function | Prototype | Description |
---|---|---|
- MC_CheckLibVersion | - int MC_CheckLibVersion(int *pLibUpToDate) | Checks if the lib is up to date |
- MC_StartContest | - int MC_StartContest(int ContestID, const char *pNickname, const char *pPassword) | Gets the variables from the website |
- MC_GetParam_int - MC_GetParam_float - MC_GetParam_char |
- int MC_GetParam_int(const char *pVariableName, int *pVariable_int) - int MC_GetParam_float(const char *pVariableName, float *pVariable_float) - int MC_GetParam_char(const char *pVariableName, char **ppVariable_char, unsigned int *pLength) |
Give you the variables downloaded by MC_StartContest |
- MC_AddVariableToSolution_int - MC_AddVariableToSolution_float - MC_AddVariableToSolution_char |
- int MC_AddVariableToSolution_int(const char *pVariableName, int Variable) - int MC_AddVariableToSolution_float(const char *pVariableName, float Variable) - int MC_AddVariableToSolution_char(const char *pVariableName, const char *pVariable, int Length) |
Add answers to the final solution |
- MC_SendSolution | - int MC_SendSolution(MC_ResultStruct *pResult) | Sends the final solution to the website |
- MC_ResultMessage | - char* MC_ResultMessage(MC_ResultStruct *pResult, int Print) | Prints a summary of the results (success, points...) |
- MC_ErrorMessage | - char* MC_ErrorMessage(unsigned int ErrorCode, int Print) | Prints a message associated with an error code |
Here is a list of the error codes defined in microcontest2.h :
Error Code | Value | Description |
---|---|---|
MC_OK | 0 | No error. |
MC_ERROR_VERSION | 1 | This version of the microcontest2 library does not work anymore. Please download the last one on www.microcontest.com/download.php. |
MC_ERROR_CONNECTION | 2 | A connection problem happened. |
MC_ERROR_IDENTITY | 3 | An authentification problem happened. |
MC_ERROR_IDENTITY_UNKNOWNUSER | 4 | This username does not exist. |
MC_ERROR_IDENTITY_NONACTIVATED | 5 | Your account has not been activated yet. |
MC_ERROR_IDENTITY_PASSWORD | 6 | Wrong password. |
MC_ERROR_MEMORY | 7 | A memory error happened. |
MC_ERROR_FORMAT | 8 | The data sent by the server is not formatted properly. |
MC_ERROR_UNKNOWN | 9 | An unknown error happened. |
MC_ERROR_SERVER | 10 | The HTTP server has a problem or the microcontest2 library sent incorrectly formatted data. |
MC_ERROR_BRUTEFORCE | 11 | Bruteforce error. |
MC_ERROR_BADCTENCODING | 12 | The data sent by the server is not formatted properly (Bad Chuncked Transfer Encoding). |
typedef struct { int success; int timeout; int already; int points; int error; char msg_error[1024]; } MC_ResultStruct;
int MC_CheckLibVersion(int *pLibUpToDate)
Enables you to check if the lib version if up to date.
int LibUpToDate = 0; ErrorCode = MC_CheckLibVersion(&LibUpToDate); if(ErrorCode != MC_OK) { MC_ErrorMessage(ErrorCode, 1); 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"); }
int MC_StartContest(int ContestID, const char *pNickname, const char *pPassword)
Downloads new variable values from the website and store it. You need to use MC_GetParam_xxx to get them.
ErrorCode = MC_StartContest(13, "Your nickname", "Your password"); // Challenge 13 if(ErrorCode != MC_OK) { MC_ErrorMessage(ErrorCode, 1); return 0; }
int MC_GetParam_int(const char *pVariableName, int *pVariable_int)
Once you called MC_StartContest, you can retrieve the int variables values with this function.
int Nb1 = 0, Nb2 = 0; ErrorCode = MC_GetParam_int("a", &Nb1); ErrorCode *= MC_GetParam_int("b", &Nb2); if(ErrorCode == 0) { printf("Impossible to get the contest data. Please check the ID of the contest.\n"); return 0; }
int MC_GetParam_float(const char *pVariableName, float *pVariable_float)
Once you called MC_StartContest, you can retrieve the float variables values with this function.
float Nb = 0; ErrorCode = MC_GetParam_float("height", &Nb); if(ErrorCode == 0) { printf("Impossible to get the contest data. Please check the ID of the contest.\n"); return 0; }
int MC_GetParam_char(const char *pVariableName, char **ppVariable_char, unsigned int *pLength)
Once you called MC_StartContest, you can retrieve the string variables values with this function. Note that it is the library that allocates the memory for the strings and frees it
automatically. You don't need to take care of that.
char *pCryptedText = NULL; unsigned int CryptedTextLength = 0; int Key = 0; ErrorCode = MC_GetParam_char("txt_crypte", &pCryptedText, &CryptedTextLength); ErrorCode *= MC_GetParam_int("key", &Key); if(ErrorCode == 0) { printf("Impossible to get the contest data. Please check the ID of the contest.\n"); return 0; }
int MC_AddVariableToSolution_int(const char *pVariableName, int Variable)
Once you solved the challenge, you need to add the answer(s) to the final solution. Then, you will call MC_SendSolution that will send all your answers to the website.
You should use this function to add int variables to the solution.
int Number = 0; // computing the value of Number... ErrorCode = MC_AddVariableToSolution_int("frequency", Number); if(ErrorCode == 0) { printf("Impossible to add the variable(s) to the solution\n"); return 0; }
int MC_AddVariableToSolution_float(const char *pVariableName, float Variable)
Once you solved the challenge, you need to add the answer(s) to the final solution. Then, you will can MC_SendSolution that will send all your answers to the website.
You should use this function to add float variables to the solution.
int Freq = 0; float Duration = 0; // computing the value of Freq and Duration... ErrorCode = MC_AddVariableToSolution_int("frequency", Freq); ErrorCode *= MC_AddVariableToSolution_float("duration", Duration); if(ErrorCode == 0) { printf("Impossible to add the variable(s) to the solution\n"); return 0; }
int MC_AddVariableToSolution_char(const char *pVariableName, const char *pVariable, int Length)
Once you solved the challenge, you need to add the answer(s) to the final solution. Then, you will can MC_SendSolution that will send all your answers to the website.
You should use this function to add strings to the solution.
char PlainText[] = "HELLO THIS IS THE SOLUTION STRING"; ErrorCode = MC_AddVariableToSolution_char("plain_text", PlainText, strlen(PlainText); if(ErrorCode == 0) { printf("Impossible to add the variable(s) to the solution\n"); return 0; }
int MC_SendSolution(MC_ResultStruct *pResult)
Once you solved the challenge and added all the answer variables to the solution, you need to call this function in order to send the solution to the website.
*pResult is filled with the results.
MC_ResultStruct Res; MC_AddVariableToSolution_char("txt_clair", pPlainText, strlen(pPlainText)); ErrorCode = MC_SendSolution(&Res); if(ErrorCode != MC_OK) MC_ErrorMessage(ErrorCode, 1); MC_ResultMessage(&Res, 1);
char* MC_ResultMessage(MC_ResultStruct *pResult, int Print)
Once you sent the solution, a MC_ResultStruct structure has been filled. Use this function to get a formatted summary
of the results. You can choose to print it or the get a pointer on the formatted string.
MC_ResultStruct Res; MC_AddVariableToSolution_char("txt_clair", pPlainText, strlen(pPlainText)); ErrorCode = MC_SendSolution(&Res); if(ErrorCode != MC_OK) MC_ErrorMessage(ErrorCode, 1); MC_ResultMessage(&Res, 1);
char* MC_ErrorMessage(unsigned int ErrorCode, int Print)
Most of the functions of the library return an error code. You can consult the meaning here, or use this function.
MC_ResultStruct Res; MC_AddVariableToSolution_char("txt_clair", pPlainText, strlen(pPlainText)); ErrorCode = MC_SendSolution(&Res); if(ErrorCode != MC_OK) MC_ErrorMessage(ErrorCode, 1); MC_ResultMessage(&Res, 1);