QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#121430 | #5642. DA-Sort | kaitlinz | 0 | 42ms | 8556kb | Python3 | 774b | 2023-07-08 06:09:43 | 2023-07-08 06:09:45 |
Judging History
answer
def ceiling_division(n, d):
q, r = divmod(n, d)
return q + bool(r)
def solve(arr):
newArr = sorted(arr[:])
idx, newidx = 0,0
while idx < len(arr) and newidx < len(newArr):
print(arr[idx], " ", newArr[newidx])
if arr[idx] == newArr[newidx]:
idx+=1
newidx+=1
else: # arr[idx] < newArr[newidx]:
idx += 1
return len(newArr) - newidx
setNum = int(input())
for i in range(setNum):
probNum, elems = [int(x) for x in input().split()]
arr = []
for j in range(ceiling_division(elems, 10)):
arr += [int(x) for x in input().split()]
print(sorted(arr))
print(arr)
print(solve(arr))
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 42ms
memory: 8556kb
input:
50 1 3 1 3 2 2 6 1 5 2 4 3 6 3 23 67890 56312 999999999 12345 23456 38927 45632 100345 98765 23456 87654 43278 23456 117654 321899 25432 54326 217435 26845 31782 33456 41234 56213 4 1000 18780 15256 15263 15268 15269 15274 15279 15279 15283 15290 15292 15292 15295 15298 15302 15305 15305 15311 15316...
output:
[1, 2, 3] [1, 3, 2] 1 1 3 2 2 2 1 [1, 2, 3, 4, 5, 6] [1, 5, 2, 4, 3, 6] 1 1 5 2 2 2 4 3 3 3 6 4 3 [12345, 23456, 23456, 23456, 25432, 26845, 31782, 33456, 38927, 41234, 43278, 45632, 54326, 56213, 56312, 67890, 87654, 98765, 100345, 117654, 217435, 321899, 999999999] [67890, 56312,...
result:
wrong answer 1st lines differ - expected: '1 1', found: '[1, 2, 3]'