QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#121429 | #5642. DA-Sort | kaitlinz | 0 | 27ms | 8580kb | Python3 | 832b | 2023-07-08 06:08:14 | 2023-07-08 06:08:14 |
Judging History
answer
# Online Python - IDE, Editor, Compiler, Interpreter
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))
詳細信息
Test #1:
score: 0
Wrong Answer
time: 27ms
memory: 8580kb
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]'