- 359 名前:デフォルトの名無しさん mailto:sage [2018/11/10(土) 17:52:39.10 ID:AvCW4uHY.net]
- python
def ans(num): _def calc(N): __n = (N ** 2) % 100 __p = [] __while n not in p: ___p.append(n) ___n = (n * N) % 100 __return p _loop = calc(num) _step = num**num % len(loop) _if len(loop) == 1: __print(loop[0]) _else: __print(loop[step-2]) for x in [0,1,2,3,4,5,10,11,13,777]: _ans(x) -> 0,1,16,87,96,25,0,11,53,97
|

|