Submission #70767567
Source Code Expand
X = int(input())
N = int(input())
W = list(map(int,input().split()))
Q = int(input())
P = [int(input()) for _ in range(Q)]
parts = [0]*N
Weight = X
for i in range(Q):
QueryP = P[i] -1
if parts[QueryP] == 0:
parts[QueryP] = 1
Weight += W[QueryP]
elif parts[QueryP] == 1:
parts[QueryP] = 0
Weight -= W[QueryP]
print(Weight)
Submission Info
| Submission Time | |
|---|---|
| Task | B - Robot Weight |
| User | NNN_125128 |
| Language | Python (PyPy 3.11-v7.3.20) |
| Score | 200 |
| Code Size | 390 Byte |
| Status | AC |
| Exec Time | 57 ms |
| Memory | 80436 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_00.txt, 00_sample_01.txt |
| All | 00_sample_00.txt, 00_sample_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 01_random_16.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_00.txt | AC | 55 ms | 79976 KiB |
| 00_sample_01.txt | AC | 56 ms | 79812 KiB |
| 01_random_02.txt | AC | 56 ms | 80324 KiB |
| 01_random_03.txt | AC | 56 ms | 80436 KiB |
| 01_random_04.txt | AC | 57 ms | 80228 KiB |
| 01_random_05.txt | AC | 57 ms | 80324 KiB |
| 01_random_06.txt | AC | 57 ms | 80300 KiB |
| 01_random_07.txt | AC | 57 ms | 80320 KiB |
| 01_random_08.txt | AC | 57 ms | 79944 KiB |
| 01_random_09.txt | AC | 56 ms | 80264 KiB |
| 01_random_10.txt | AC | 57 ms | 80088 KiB |
| 01_random_11.txt | AC | 56 ms | 79948 KiB |
| 01_random_12.txt | AC | 55 ms | 79500 KiB |
| 01_random_13.txt | AC | 56 ms | 80196 KiB |
| 01_random_14.txt | AC | 56 ms | 80044 KiB |
| 01_random_15.txt | AC | 57 ms | 80140 KiB |
| 01_random_16.txt | AC | 56 ms | 80300 KiB |