Please sign in first.
Submission #76341053
Source Code Expand
K = int(input())
A,B = input().split()
A = list(map(int,A))
B = list(map(int,B))
A.reverse()
B.reverse()
ans_A = 0
ans_B = 0
for i in range(len(A)):
if i == 0:
ans_A += A[i]
else:
ans_A += (K**i) * A[i]
for j in range(len(B)):
if j == 0:
ans_B += B[j]
else:
ans_B += (K**j) * B[j]
print(ans_A*ans_B)
Submission Info
| Submission Time | |
|---|---|
| Task | D - Base K |
| User | meibe |
| Language | Python (CPython 3.13.7) |
| Score | 200 |
| Code Size | 374 Byte |
| Status | AC |
| Exec Time | 10 ms |
| Memory | 9144 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example0.txt, example1.txt |
| All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, example0.txt, example1.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 000.txt | AC | 9 ms | 9072 KiB |
| 001.txt | AC | 10 ms | 9040 KiB |
| 002.txt | AC | 10 ms | 9052 KiB |
| 003.txt | AC | 10 ms | 9144 KiB |
| 004.txt | AC | 10 ms | 9052 KiB |
| 005.txt | AC | 10 ms | 9040 KiB |
| 006.txt | AC | 10 ms | 9056 KiB |
| 007.txt | AC | 10 ms | 9052 KiB |
| example0.txt | AC | 10 ms | 9144 KiB |
| example1.txt | AC | 10 ms | 9072 KiB |