Submission #1730130


Source Code Expand

#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main(){
    vector<ll> q;
    int n,x,c;
    cin >> n >> c;
    for(int i = 0; i < n; i++){
        cin >> x;
        q.push_back(x);
    }
    sort(q.begin(), q.end());
    ll ans = n,i = 0;
    for(int j = (q.size() - 1); j >= 0 && i < j; j--){
        if(c > (q[j] + q[i])) {
            i++;
            ans--;
        }
    }
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task C - 収納
User hanahana
Language C++14 (GCC 5.4.1)
Score 300
Code Size 468 Byte
Status AC
Exec Time 49 ms
Memory 1400 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 16
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
01.txt AC 49 ms 1400 KB
02.txt AC 48 ms 1400 KB
03.txt AC 31 ms 1400 KB
04.txt AC 45 ms 1400 KB
05.txt AC 26 ms 1400 KB
06.txt AC 19 ms 1400 KB
07.txt AC 28 ms 1400 KB
08.txt AC 36 ms 1400 KB
09.txt AC 39 ms 1400 KB
10.txt AC 19 ms 1400 KB
11.txt AC 48 ms 1400 KB
12.txt AC 48 ms 1400 KB
13.txt AC 29 ms 1400 KB
sample_01.txt AC 1 ms 256 KB
sample_02.txt AC 1 ms 256 KB
sample_03.txt AC 1 ms 256 KB