A little help needed [Solved] (How to use TopCoder judgement system + Class Generator)

Правка en5, от AliArapov221, 2024-04-29 10:29:35

Does anybody know how to get variables in TopCoder and return answer using c++? Like in almost in every other judge i use std::cin but in TopCoder it gives you variables like in function. Can anybody send example code?

Thanks to nilucf19 for giving me link to tutorial! Let's consider next example:

Class:	XMarksTheSpot
Method:	countArea
Parameters:	String[]
Returns:	int

So to get variables you should make class with name after "Class: ", within you have to write public function with type written after "Returns: " named after "Method: ", with parameters listed after "Parameters: "

So in this case it should look like this:

class XMarksTheSpot{
public:
    int countArea(vector <string> s){
        
    }
};

Outside class you can write your own templates, defines, global variables, etc. To run your own testcase, you can use Test Panel in web arena and Test Button on applet arena.

More in : https://www.topcoder.com/thrive/articles/competitive-programming-at-topcoder-a-step-by-step-guide

And: https://www.topcoder.com/community/competitive-programming/how-to-compete

Also there's little generator in which you just input first four lines after "Definition" and it creates class named after it:

https://pastebin.com/gSHe6SFU

Sorry for my bad english.

Теги c++, help, topcoder

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en5 Английский AliArapov221 2024-04-29 10:29:35 1177 Tiny change: 'ep-guide\nAnd: htt' -> 'ep-guide\n\nAnd: htt'
en4 Английский AliArapov221 2024-04-29 07:09:50 24 Tiny change: 'mple code?' -> 'mple code? (Sorry for bad english)'
en3 Английский AliArapov221 2024-04-29 06:41:56 31 Tiny change: ' function.' -> ' function. Can anybody send example code?'
en2 Английский AliArapov221 2024-04-29 06:38:20 19
en1 Английский AliArapov221 2024-04-29 06:37:31 190 Initial revision (published)