Power - Mod Power

Sort by

recency

|

320 Discussions

|

  • + 0 comments

    a=int(input()) b=int(input()) m=int(input()) print(f"{pow(a,b)}\n{pow(a,b,m)}")

  • + 0 comments

    just 4 lines

    x=int(input())
    y=int(input())
    m=int(input())
    print(pow(x,y),pow(x,y,m),sep="\n")
    
  • + 0 comments

    For Python3

    import math from math import pow

    a=int(input()) b=int(input()) m=int(input()) print(int(pow(a,b))) print(a**b %m)

  • + 0 comments

    For Python3

    I guess this is as simple as it can get. If anyone didn't understand, feel free to comment and I will try to explain

    a = int(input())
    b = int(input())
    m = int(input())
    
    print(pow(a, b))
    print(pow(a, b, m))
    
  • + 0 comments

    a=int(input()) b=int(input()) m=int(input()) print(pow(a,b)) print(pow(a,b,m))