Submission
Status:
[TSSSSSSSSSSSSSSSSSSS]
Score: 0
User: Winzzwz
Problemset: ยกกำลัง
Language: cpp
Time: 0.299 second
Submitted On: 2024-11-10 22:50:48
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int q;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
cin >> q;
ll mo = 1000000007;
while (q--) {
int n,m;
cin >> n >> m;
ll s = n;
m--;
while (m--) {
s = (s*n)%mo;
}
cout << s%mo << "\n";
}
return 0;
}