| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1299186 | tab | Pot (COCI15_pot) | C++20 | 1 ms | 576 KiB |
#include "bits/stdc++.h"
using namespace std;
#define intt int
#define fi first
#define se second
const intt mxN = 1e5 + 5;
const intt LG = 20;
const intt inf = 1e18;
const intt mod = 10007;
intt n, X;
intt binpow(intt a, intt b) {
intt res = 1;
while(b) {
if(b & 1) res = (res * a);
a = (a * a);
b/=2;
}
return res;
}
void _() {
cin >> n;
for(intt i = 0; i < n; i++) {
intt num, pot;
cin >> num;
pot = num%10;
X += binpow((num-pot)/10,pot);
}
cout << X << endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
intt t = 1, buu = 1;
// cin >> t;
while(t--){
// cout << "Case #" << buu++ << ": ";
_();
}
}컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
