Submission

Status:

[TSSSSSSSSSSSSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: Karatat007

Problemset: ยกกำลัง

Language: cpp

Time: 0.293 second

Submitted On: 2026-10-09 15:12:57

#include <bits/stdc++.h>
using namespace std;

long long c = 1000000007LL;
long long power(long long a,long long b){
    long long ans;
    ans = a;
    for(int i = 1;i <= b;++i){
        ans = fmodl((ans*a),c);
    }
    return ans;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;
    for(int i = 1;i <= n;++i){
        long long x,y;
        cin >> x >> y;
        cout << power(x,y) << '\n';
    }
}