Submission #61574115


Source Code Expand

#include <bits/stdc++.h>

using namespace std;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    long ans = 0;
    for (int i = 0; i < N; i++) {
        auto it = lower_bound(A.begin(), A.end(), A[i] * 2);
        ans += A.end() - it;
    }
    cout << ans << endl;
}

Submission Info

Submission Time
Task C - Various Kagamimochi
User thedekopin0108
Language C++ 20 (gcc 12.2)
Score 300
Code Size 364 Byte
Status AC
Exec Time 139 ms
Memory 5048 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 30
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_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, 01_random_17.txt, 01_random_18.txt, 01_random_19.txt, 01_random_20.txt, 01_random_21.txt, 01_random_22.txt, 02_handmade_23.txt, 02_handmade_24.txt, 02_handmade_25.txt, 02_handmade_26.txt, 02_handmade_27.txt, 02_handmade_28.txt, 02_handmade_29.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3472 KiB
00_sample_01.txt AC 1 ms 3476 KiB
00_sample_02.txt AC 1 ms 3504 KiB
01_random_03.txt AC 139 ms 4944 KiB
01_random_04.txt AC 139 ms 4924 KiB
01_random_05.txt AC 139 ms 5000 KiB
01_random_06.txt AC 138 ms 4936 KiB
01_random_07.txt AC 139 ms 5016 KiB
01_random_08.txt AC 137 ms 4944 KiB
01_random_09.txt AC 139 ms 4936 KiB
01_random_10.txt AC 73 ms 4284 KiB
01_random_11.txt AC 44 ms 3728 KiB
01_random_12.txt AC 22 ms 3596 KiB
01_random_13.txt AC 87 ms 5012 KiB
01_random_14.txt AC 86 ms 4980 KiB
01_random_15.txt AC 86 ms 4924 KiB
01_random_16.txt AC 113 ms 5008 KiB
01_random_17.txt AC 114 ms 4964 KiB
01_random_18.txt AC 113 ms 4924 KiB
01_random_19.txt AC 1 ms 3476 KiB
01_random_20.txt AC 1 ms 3672 KiB
01_random_21.txt AC 1 ms 3600 KiB
01_random_22.txt AC 1 ms 3484 KiB
02_handmade_23.txt AC 101 ms 5048 KiB
02_handmade_24.txt AC 35 ms 3940 KiB
02_handmade_25.txt AC 80 ms 4664 KiB
02_handmade_26.txt AC 10 ms 3512 KiB
02_handmade_27.txt AC 103 ms 5012 KiB
02_handmade_28.txt AC 130 ms 5004 KiB
02_handmade_29.txt AC 51 ms 5000 KiB