當前位置: 首頁>>代碼示例>>Python>>正文


Python Checker.readLine方法代碼示例

本文整理匯總了Python中checker.Checker.readLine方法的典型用法代碼示例。如果您正苦於以下問題:Python Checker.readLine方法的具體用法?Python Checker.readLine怎麽用?Python Checker.readLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在checker.Checker的用法示例。


在下文中一共展示了Checker.readLine方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: main

# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
  ch = Checker()

  while True:
    n = int(ch.readLine())
    if n == 0:
      break
    ch.checkRange(n, 3, 50, 'n')
    ps = []
    for _ in range(n):
      x, y = [int(w) for w in ch.readLine().strip().split()]
      ch.check((x, y) not in ps, "no dup points: (%d, %d)" % (x, y))
      ch.checkRange(x, -500, 500, 'x')
      ch.checkRange(y, -500, 500, 'y')
      ps.append((x, y))
開發者ID:AI-comp,項目名稱:Orientation2014Problems,代碼行數:17,代碼來源:validator.py

示例2: main

# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
  ch = Checker()

  while True:
    n = int(ch.readLine())
    if n == 0:
      break
    ch.checkRange(n, 1, 5, 'n')
    ps = set()
    ps.add((0, 0))
    for _ in range(n):
      x, y = [int(w) for w in ch.readLine().strip().split()]
      ch.check((x, y) not in ps, "no dup points")
      ch.checkRange(x, -50, 50, 'x')
      ch.checkRange(y, -50, 50, 'y')
      ps.add((x, y))
開發者ID:AI-comp,項目名稱:Orientation2014Problems,代碼行數:18,代碼來源:validator.py

示例3: main

# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
  ch = Checker()

  while True:
    n = int(ch.readLine())
    if n == -1:
      break
    ch.checkRange(n, 0, 23, 'n')
    ps = set()
    ps.add((1, 1))
    ps.add((5, 5))
    for _ in range(n):
      x, y = [int(w) for w in ch.readLine().strip().split()]
      ch.check((x, y) not in ps, 'no dup points')
      ch.checkRange(x, 1, 5, 'x')
      ch.checkRange(y, 1, 5, 'y')
      ps.add((x, y))
開發者ID:AI-comp,項目名稱:Orientation2014Problems,代碼行數:19,代碼來源:validator.py

示例4: main

# 需要導入模塊: from checker import Checker [as 別名]
# 或者: from checker.Checker import readLine [as 別名]
def main():
  ch = Checker()

  while True:
    a = int(ch.readLine())
    if a == -1:
      break
    ch.checkRange(a, 0, 315, 'd')
    ch.check(a % 45 == 0, 'd is a multiple of 45')
開發者ID:AI-comp,項目名稱:Orientation2014Problems,代碼行數:11,代碼來源:validator.py


注:本文中的checker.Checker.readLine方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。