示例#1
0
 def test_problem_c(self):
     self.assertEqual(
         c.solve(4, 6, ['X...XX', '...XX.', '.X..X.', '......'], (1, 6),
                 (2, 2)), 'YES')
     self.assertEqual(
         c.solve(5, 4, ['.X..', '...X', 'X.X.', '....', '.XX.'], (5, 3),
                 (1, 1)), 'NO')
     self.assertEqual(
         c.solve(4, 7, ['..X.XX.', '.XX..X.', 'X...X..', 'X......'], (2, 2),
                 (1, 6)), 'YES')
     self.assertEqual(c.solve(2, 2, ['..', 'XX'], (2, 1), (1, 1)), 'YES')
示例#2
0
 def test_problem_c(self):
     self.assertEqual(c.solve(3, ['rivest', 'shamir', 'adleman']),
                      'bcdefghijklmnopqrsatuvwxyz')
     self.assertEqual(
         c.solve(10, [
             'tourist', 'petr', 'wjmzbmr', 'yeputons', 'vepifanov',
             'scottwu', 'oooooooooooooooo', 'subscriber', 'rowdark',
             'tankengineer'
         ]), 'Impossible')
     self.assertEqual(
         c.solve(10, [
             'petr', 'egor', 'endagorion', 'feferivan',
             'ilovetanyaromanova', 'kostka', 'dmitriyh', 'maratsnowbear',
             'bredorjaguarturnik', 'cgyforever'
         ]), 'agnhjlopefikdmbcqrstuvwxyz')
示例#3
0
 def test_problem_c(self):
     self.assertEqual(
         c.solve(10, [
             [2, 1],
             [3, 1],
             [4, 2],
             [5, 1],
             [6, 2],
             [7, 5],
             [8, 6],
             [9, 8],
             [10, 5],
         ], [1, 0, 1, 1, 0, 1, 0, 1, 0, 1], [1, 0, 1, 0, 0, 1, 1, 1, 0, 1]),
         [4, 7])
     self.assertEqual(c.solve(3, [
         [1, 2],
         [1, 3],
     ], [1, 1, 1], [0, 0, 0]), [1, 2, 3])
示例#4
0
 def test_problem_c(self):
     self.assertEqual(c.solve(6, 3), 4)
     self.assertEqual(c.solve(8, 5), 3)
     self.assertEqual(c.solve(22, 4), 6)
示例#5
0
def test_solve(start, stop, expected):
    assert c.solve(start, stop) == expected
示例#6
0
 def test_problem_c(self):
     self.assertEqual(c.solve(4, [2, 1, 3], [2, 4, 2]), '6 2')
     self.assertEqual(c.solve(3, [1, 2], [2, 1, 3]), -1)