Блог пользователя AliArapov221

Автор AliArapov221, история, 4 недели назад, По-английски

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.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

Автор AliArapov221, история, 3 месяца назад, По-русски

Does anybody know how to make Geany's compiler more 'strict'? By 'strict' i mean that Geany has to give warnings for silly mistakes, like opening same varible twice or trying to access out of bound element in array.

And if you also know, is there any way to do it without downloading anything, like plugins, because when i will go to some contest which i won't have access for my laptop, i probably won't have access to download anything. If needed i can switch to another code editor which is in IOI whitelist.

Полный текст и комментарии »

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится