Submission #67167646


Source Code Expand

#include<iostream>
#include<algorithm>
#define int long long
using namespace std;
int n,a[200001],T,b,e,ans;
void go_work()
{
    cin >> n;
    for(int i = 1;i <= n;i++) cin >> a[i];
    b = a[1],e = a[n],ans = 0;
    sort(a + 1,a + n + 1);
    while(b < e)
    {
        if(ans > n)
        {
            cout << -1 << endl;
            return;
        }
        ans++;
        b = a[upper_bound(a + 1,a + n + 1,b * 2) - a - 1];
    }
    cout << ans + 1 << endl;
}
signed main()
{
    cin >> T;
    while(T--) go_work();
    return 0;
}

Submission Info

Submission Time
Task C - Giant Domino
User Loki_zhang
Language C++ 20 (gcc 12.2)
Score 0
Code Size 566 Byte
Status WA
Exec Time 159 ms
Memory 5208 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 1
AC × 20
WA × 12
Set Name Test Cases
Sample 00_sample_00.txt
All 00_sample_00.txt, 01_small_00.txt, 01_small_01.txt, 01_small_02.txt, 01_small_03.txt, 01_small_04.txt, 01_small_05.txt, 01_small_06.txt, 01_small_07.txt, 01_small_08.txt, 02_random_00.txt, 02_random_01.txt, 02_random_02.txt, 02_random_03.txt, 02_random_04.txt, 02_random_05.txt, 02_random_06.txt, 02_random_07.txt, 02_random_08.txt, 02_random_09.txt, 02_random_10.txt, 02_random_11.txt, 02_random_12.txt, 02_random_13.txt, 02_random_14.txt, 02_random_15.txt, 02_random_16.txt, 02_random_17.txt, 02_random_18.txt, 02_random_19.txt, 03_corner_00.txt, 03_corner_01.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3412 KiB
01_small_00.txt WA 64 ms 3468 KiB
01_small_01.txt WA 63 ms 3416 KiB
01_small_02.txt WA 46 ms 3508 KiB
01_small_03.txt WA 159 ms 3488 KiB
01_small_04.txt WA 124 ms 3416 KiB
01_small_05.txt WA 105 ms 3544 KiB
01_small_06.txt WA 94 ms 3536 KiB
01_small_07.txt WA 73 ms 3536 KiB
01_small_08.txt WA 63 ms 3476 KiB
02_random_00.txt WA 31 ms 4344 KiB
02_random_01.txt WA 60 ms 5024 KiB
02_random_02.txt AC 60 ms 5100 KiB
02_random_03.txt AC 42 ms 4576 KiB
02_random_04.txt WA 60 ms 5068 KiB
02_random_05.txt AC 43 ms 5116 KiB
02_random_06.txt AC 45 ms 5000 KiB
02_random_07.txt AC 45 ms 5104 KiB
02_random_08.txt AC 39 ms 4804 KiB
02_random_09.txt AC 45 ms 4996 KiB
02_random_10.txt AC 45 ms 5040 KiB
02_random_11.txt AC 35 ms 4668 KiB
02_random_12.txt AC 47 ms 4968 KiB
02_random_13.txt AC 45 ms 4972 KiB
02_random_14.txt AC 39 ms 4772 KiB
02_random_15.txt AC 45 ms 5164 KiB
02_random_16.txt AC 44 ms 5004 KiB
02_random_17.txt AC 40 ms 5000 KiB
02_random_18.txt AC 45 ms 5208 KiB
02_random_19.txt AC 45 ms 5044 KiB
03_corner_00.txt AC 1 ms 3444 KiB
03_corner_01.txt AC 1 ms 3552 KiB