Top 20

1 0x00h 700 pts
2 boris39 700 pts
3 neoxquick 681 pts
4 maf-ia 662 pts
5 thefinder 644 pts
6 benito255 608 pts
7 mego 591 pts
8 madbat2 581 pts
9 Mart 553 pts
10 Stupefy 533 pts
11 nikokks 512 pts
12 tehron 504 pts
13 Kithyane 502 pts
14 plucth 480 pts
15 egosum 473 pts
16 CoYoTe99 416 pts
17 Undr 415 pts
18 Zeta 415 pts
19 loonies2 411 pts
20 Armavica 409 pts

Classement complet

Shoutbox

12 May - 11:47 am

Working again now.

10 May - 4:05 pm

Hello, sorry for the late answer, in fact yes there is an issue with the mail, we will try to fix it quickly. Thanks for reporting

7 May - 6:07 pm

Hi there is a issue for the challenfe Email (number 21). I don't receive a mail on any of them: gmail, hotmail, yahoo. do i fail or is it the challenge ?

28 Feb - 10:35 am

Yes we fixed it

27 Feb - 10:00 pm

Thank you, just validated contest22. The solution checker seems to have been fixed.

27 Feb - 8:40 am

Yes several solutions are accepted of course. I will check one of your answers

26 Feb - 7:51 pm

No 500 error, but the solutions I'm submitting can be verified to be correct. It can't be that only one configuration is accepted, right? - as there are multiple correct configurations for each problem.

26 Feb - 5:54 pm

contest 22 is not concerned by the issue I found, and seems to be working (I suppose you don't have 500 error on this one ?). Your solutions are indeed rejected, but I did not check them yet

26 Feb - 3:25 pm

The validation for contest 22 also seems to be wrong (it's not accepting solutions that are clearly correct). I submitted bug report yesterday.

26 Feb - 9:59 am

Ok I fixed the issue It is higly possible that other challenges are impacted, so don't hesitate to tell meif you encounter this again. Thank you for reporting

Connexion
Mot de passe oublié

Supportez nousx

Vous aimez µContest ?
Supportez nous en votant (fun et difficulté) pour µContest sur WeChall :)
Si vous ne l'avez pas encore fait, profitez-en pour lier votre compte
Wechall à µContest pour pouvoir voter !

Merci

Contents

µ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.

General

How to solve a challenge

The µContest libraries

Example of a challenge resolution I

Example of a challenge resolution II

Technical documentations

Example of a challenge resolution II

Example presention

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.

Solution in C/C++

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;
}
download source file (copy/paste adds special characters)

Solution in Python

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())
download source file (copy/paste adds special characters)

Solution in Java

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());
	}
}
download source file (copy/paste adds special characters)

Solution in PHP

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);

?>
download source file (copy/paste adds special characters)
Remove the '_' at the end of the file name

Solution in any other language

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.