Submission #17408376


Source Code Expand

Copy
scale=0
define merge_sort(left, right){
    auto mid, i, j, k, l, s
    if(left == right || left == right-1)return
    mid = (left+right)/2
    s=merge_sort(left, mid)
    s=merge_sort(mid, right)
    i = left
    j = mid
    k = 0
    while(i < mid && j < right){
        if(a[i] <= a[j]){
            b[k++] = a[i++]
        }else{
            b[k++] = a[j++]
        }
    }
    if(i == mid){
        while(j < right){
            b[k++] = a[j++]
        }
    }else{
        while(i < mid){
            b[k++] = a[i++]
        }
    }
    for(l=0;l<k;l++){
        a[left+l] = b[l]
    }
}

n=read()
for(i=0;i<n;i++)a[i]=read()
s=merge_sort(0, n)
q=A^5
for(i=0;i<n/2;i++){
    temp = a[i]+a[n-1-i]
    if(p<temp)p=temp
    if(q>temp)q=temp
}
p-q

Submission Info

Submission Time
Task A - Table Tennis
User Rssll_Krkgrd
Language bc (1.07.1)
Score 100
Code Size 750 Byte
Status AC
Exec Time 10 ms
Memory 2268 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 27
Set Name Test Cases
All 00-sample-00.txt, 00-sample-01.txt, 10-unique-00.txt, 10-unique-01.txt, 10-unique-02.txt, 10-unique-03.txt, 10-unique-04.txt, 20-order-00.txt, 20-order-01.txt, 20-order-02.txt, 20-order-03.txt, 20-order-04.txt, 30-random-00.txt, 30-random-01.txt, 30-random-02.txt, 30-random-03.txt, 30-random-04.txt, 30-random-05.txt, 30-random-06.txt, 30-random-07.txt, 30-random-08.txt, 30-random-09.txt, 30-random-10.txt, 30-random-11.txt, 30-random-12.txt, 30-random-13.txt, 30-random-14.txt
Case Name Status Exec Time Memory
00-sample-00.txt AC 2 ms 2144 KB
00-sample-01.txt AC 2 ms 2112 KB
10-unique-00.txt AC 2 ms 2144 KB
10-unique-01.txt AC 3 ms 2152 KB
10-unique-02.txt AC 6 ms 2268 KB
10-unique-03.txt AC 4 ms 2204 KB
10-unique-04.txt AC 3 ms 2204 KB
20-order-00.txt AC 2 ms 2132 KB
20-order-01.txt AC 7 ms 2252 KB
20-order-02.txt AC 2 ms 2208 KB
20-order-03.txt AC 4 ms 2252 KB
20-order-04.txt AC 2 ms 2200 KB
30-random-00.txt AC 2 ms 2252 KB
30-random-01.txt AC 10 ms 2076 KB
30-random-02.txt AC 2 ms 2064 KB
30-random-03.txt AC 3 ms 2252 KB
30-random-04.txt AC 3 ms 2148 KB
30-random-05.txt AC 3 ms 2208 KB
30-random-06.txt AC 3 ms 2260 KB
30-random-07.txt AC 3 ms 2120 KB
30-random-08.txt AC 2 ms 2140 KB
30-random-09.txt AC 3 ms 2200 KB
30-random-10.txt AC 2 ms 2112 KB
30-random-11.txt AC 3 ms 2200 KB
30-random-12.txt AC 3 ms 2160 KB
30-random-13.txt AC 7 ms 2168 KB
30-random-14.txt AC 2 ms 2200 KB