예제 #1
0
 def test_threading(self):
     t = time.time()
     judge(
         '#include <cstdio>\nint main() {\n    int a, b;\n    scanf("%d %d", &a, &b);\n    printf("%d", a / b);\n    while (true)\n        ;\n    return 0;\n}\n',
         [('1 1', '1')] * 10, .1)
     self.assertAlmostEqual(time.time() - t, .1, 0)
예제 #2
0
 def test_case(self):
     self.assertEqual(
         judge(
             '#include <cstdio>\nint main() {\n    int a, b;\n    scanf("%d %d", &a, &b);\n    printf("%d", a / b);\n    return 0;\n}\n',
             [('1 1', '1'), ('2 2', '4'), ('1 0', '0')])[0],
         ['AC', 'WA', 'RE'])
예제 #3
0
 def test_TLE(self):
     self.assertEqual(
         judge(
             '#include <cstdio>\nint main() {\n    int a, b;\n    scanf("%d %d", &a, &b);\n    printf("%d", a / b);\n    while (true)\n        ;\n    return 0;\n}\n',
             [('1 1', '1')], .1), (['TLE'], [100]))
예제 #4
0
 def test_RE(self):
     self.assertEqual(
         judge(
             '#include <cstdio>\nint main() {\n    int a, b;\n    scanf("%d %d", &a, &b);\n    printf("%d", a / b);\n    return 0;\n}\n',
             [('1 0', '0')])[0], ['RE'])
예제 #5
0
 def test_CE(self):
     self.assertEqual(judge('', [], 0, True), 'CE')