Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
43560 | wuxinyue | 幂的末尾 | C++ | Accepted | 0 MS | 244 KB | 354 | 2024-03-16 20:20:13 |
#include<bits/stdc++.h> using namespace std; int main(){ long long a; cin >> a; a = a % 1000; int s = a % 1000; long long b; cin >> b; int i = 1; while(i < b){ a *= s; a = a % 1000; i ++; } if (a < 10){ cout << "00" << a; } else if (a < 100){ cout << "0" << a; } else{ cout << a % 1000; } return 0; }