Submission details
Task:Exponentiation
Sender:aalto26kh_016
Submission time:2026-11-16 14:58:15 +0200
Language:C++ (C++20)
Status:READY
Result:ACCEPTED
Test results
testverdicttime
#1ACCEPTED0.02 sdetails
#2ACCEPTED0.48 sdetails
#3ACCEPTED0.53 sdetails

Code

#include <iostream>
#include <vector>
#include <climits>
#include <cstdint>

using namespace std;
#define DEBUG std::cout<<"LINE"<<__LINE__;
#define IN(A) int A;std::cin>>A;
#define M 1000000007
template<typename T> void printV(vector<T> V) {
    for (int i=0;i<V.size()-1;i++) {
        cout<<V[i]<<" ";
    }

    cout<<V[V.size()-1];
    cout<<endl;
}
int64_t max3(int64_t a,int64_t b,int64_t c) {
    return max(a,max(b,c));
}
struct compute {
    int tests=1;
 //   vector<int> b;;
 //   vector<int> a;
    vector<pair<int,int>> result;
    vector<bool> visited;
    bool start() {
        IN(n);

        for (int i=0;i<n;i++) {
            IN(a);
            IN(b);
            cout<<modPow(a,b,M)<<endl;

        }
        return true;
    }
    uint64_t modPow(int a, int b, int m) {
        if (b==0) return 1;
        uint64_t u=modPow(a,b/2,m);
        u=(u*u)%m;
        if (b&1) u=(u*a)%m;
        return u;
    }

    void readV(int n) {
      //  for (int i=0;i<n;i++) cin>>data[i];

    }
    void testloop(){
        while (tests-->0) {
            start();
        }
    }
};

int main() {
    ios_base::sync_with_stdio(false);
   // cin.tie(NULL);
    compute comp;
    comp.start();


}

Test details

Test 1

Verdict: ACCEPTED

input
10201
0 0
0 1
0 2
0 3
...

correct output
1
0
0
0
0
...

user output
1
0
0
0
0
...

Test 2

Verdict: ACCEPTED

input
200000
129612095 411099530
241615980 487174929
60862511 511830781
758816482 982657640
...

correct output
276067146
838400234
148093882
546897305
467086232
...

user output
276067146
838400234
148093882
546897305
467086232
...

Test 3

Verdict: ACCEPTED

input
200000
692427692 536870911
252480658 536870911
505090334 536870911
27194853 536870911
...

correct output
940305728
707431813
917260341
908974199
375947818
...

user output
940305728
707431813
917260341
908974199
375947818
...