Skip to content

Create Single Round Match Problem Using MPSQAS Client

skyhit edited this page Jan 16, 2015 · 2 revisions

Create and test problem

Create SRM Problem

1.Run mpsqas-client/mpsqas.bat (or mpsqas.sh) locally or though Java Web Start using http://tc.cloud.topcoder.com/contest/arena/MPSQASProd.jnlp. You may meet Java Security problem, please follow https://www.java.com/en/download/help/java_blocked.xml to add http://tc.cloud.topcoder.com to the Exception Site list.

Uncheck “Use SSL”, login as sandking/password

2.Click “Problems” -> “Main Individual Problem Room”, then click “Create Problem” button.

3.Input

  • “Class Name” as “TestProb”
  • “Method Name” as “sum”
  • “Parameters” as “int A, int B”
  • “Returns” as “int”
  • “Round Type” as “Individual Problem Round”

“Division 2” and “Easy” Then click “Submit” button.

4.Click “Problems” -> “Main Individual Problem Room”, then “Select the TestProblem”, Click “View Problem” button

5.The definition is almost ready, just select problem type with “Simple Math”

6.Now we need to edit the Introduction, Notes, Constraints, you can following the snapshots or fill anything you like

Click the “Save Statement” in the right part of panel

7.Click the “Statement Preview”, and click “Generate Preview”, you can see the following problem statement

Don’t forget to submit the problem again

Publish the problem

1.Logout and Login as heffan/password.

2.Click “Admin” -> “Pending Single Problems”, then select the problem and Click “View Problem”

3.Click “Admin” tab, and select Status to “Final Testing”, then select user “lightspeed” and click “Add” to assign him as a tester, and then click “Save Changes”

Create problem solution

1.Logout and Login as sandking/password.

2.View the same problem, go to “Solution” tab, and paste following code to the text area and click “compile”

public class TestProb {
    public String checkData(int A, int B) {
        if (A < 1 || A > 100) return "A must be between 1 and 100, inclusive.";
        if (B < 1 || B > 100) return "B must be between 1 and 100, inclusive.";
        return "";
    }

    public int sum(int A, int B) {
        return A + B;
    }
}

3.Go to “Test Data” tab, add at least 5 test cases, make 2 of them as an example, click “Submit” make sure the problem can be submitted successfully.

Test Java in mpsqas client

1.Logout and Login as lightspeed/password.

2.Click “Problems” -> “Main Individual Problem Room”, then click “View Problem” button

3.Go to “Solution” tab, Select language with “Java”, paste following code and click “Compile”

public class TestProb {
    public int sum(int A, int B) {
    		/*
    		uncomment to test with time limit and memory limit*/
    		int size = 3000;
    		String[.png| content ]]
    		for(int i=0;i<size;i++) 
    			for(int j=0;j<size;j++) {
					bb[i.png| content ]]
    		}
    		
            return A+B;
        }
}

4.Go to “Test Data” tab, and select one example test data, click “Test”

5.You can reduce the values of “execution time limit” or “memory limit” as user sandking/password, and click “Save Statement”, you can first set Time limit = 1 Memory limit = default, and then Time limit = default and Memory limit = 12

6.We can see the result of Time limit with 1 millsecond

7.We can see the result of Memory limit with 12 MB

Test C++ in mpsqas client

1.Paste following code and click “Compile”, “Test”

#include <iostream>
#include <vector>
#include <string>
using namespace std;

const int size = 6000;
int bb[size.png| content ]]
class TestProb {
    public:
        int sum(int A, int B) {
        	/*
    		uncomment to test with time limit and memory limit*/

    		for(int i=0;i<size;i++) 
    			for(int j=0;j<size;j++) {
					bb[i.png| content ]]
    		}
            return A+B;
        }
};

2.Please refer to section 5.4 to adjust the Time limit and Memory limit, we can see the result: 3.See the time limit with 1 millisecond

4.See the memory limit with 12MB

Test Python in mpsqas client

1.Paste following code and click “Compile”, “Test”

class TestProb:
    def sum(self, A, B):
        a=[.png| content ]]
        for i in range(3000): 
            a.append([.png| content ]]
            for j in range(3000): 
                a[i.png| content ]]
        return A+B

2.See the time limit with 1 millisecond, the snapshot is same with C++, so I will not repeat here again. 3.See the memory limit with 12MB

Test CSharp in mpsqas client

1.Paste following CSharp code and click “Compile”, “Test”

using System;
class TestProb
{
    public int sum(int A, int B) {
    	int[,.png| content ]]
    	for (int i=0;i<7000;i++)
        {
            for (int j=0;j<7000;j++)
            {
                bb[i,j.png| content ]]
            }
            for (int j=0;j<7000;j++)
            {
                bb[i,j.png| content ]]
            }
            for (int j=0;j<7000;j++)
            {
                bb[i,j.png| content ]]
            }
        }
    	return A+B;
    }
}

2.See the Time limit with 1 millisecond

3.See the memory with 12MB, you must enlarge the two- dimension array size to 20000, then you will see:

Test VB.net in mpsqas client

1.Paste following vb code and click “Compile”, “Test”

Class TestProb
    Public Function sum(ByVal A As Integer, ByVal B As Integer) As Integer
    	Dim bb(7000, 7000) As Integer
    	For i As Integer = 1 To 7000
		    For j As Integer = 1 To 7000
		    	bb(i,j) = i + j
		    Next
		Next

		For i As Integer = 1 To 7000
		    For j As Integer = 1 To 7000
		    	bb(i,j) = i * j
		    Next
		Next

		For i As Integer = 1 To 7000
		    For j As Integer = 1 To 7000
		    	bb(i,j) = i - j
		    Next
		Next
		Return A + B
    End Function
End Class

2.The output is same as csharp, so I will not duplicate here.