【18焦作网络赛 J】 大数开方

J - Participate in E-sports

(python) 真牛

'''
Author: zhl
Date: 2020-11-25 17:19:51
'''

from math import *
from decimal import *

getcontext().prec= 300 #设置有效位数
def sqrt(n):
    return floor(Decimal(n).sqrt())
def judge(n):
    t = sqrt(n)
    return t * t == n


for _ in range(int(input())):
    x = int(input())
    y = x * (x - 1) // 2
    a = judge(x)
    b = judge(y)

    if a and b:
        print("Arena of Valor")
    elif a and not b:
        print("Hearth Stone")
    elif not a and b:
        print("Clash Royale")
    else:
        print("League of Legends")
原文地址:https://www.cnblogs.com/sduwh/p/14042507.html