98842024-03-14 20:26:50zhuyiLoud Snackscpp17Accepted 100/10052ms11580 KiB
#include<iostream>
#include<vector>
#include<string>
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n,x;
    int v=0;
    cin>>n>>x;
    vector <int> l;
    for(int i=0;i<n;i++){
        int a=0;
        cin>>a;
        l.push_back(a);
    }
    sort(l.begin(),l.end());
    for(int i=0;i<n;i++){
        if(l[i] + l[i+1]<= x){
            v++;
            i++;
        }
        else v++;
    }
    cout<<v;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1808 KiB
2Accepted3ms1940 KiB
subtask218/18
3Accepted3ms2156 KiB
4Accepted2ms2244 KiB
5Accepted3ms2436 KiB
6Accepted2ms2308 KiB
7Accepted3ms2440 KiB
8Accepted2ms2456 KiB
9Accepted2ms2572 KiB
10Accepted3ms2712 KiB
11Accepted2ms2668 KiB
subtask321/21
12Accepted8ms3096 KiB
13Accepted9ms3264 KiB
14Accepted13ms3784 KiB
15Accepted14ms3992 KiB
16Accepted17ms4160 KiB
17Accepted20ms5168 KiB
18Accepted23ms5400 KiB
19Accepted25ms5624 KiB
20Accepted28ms6036 KiB
subtask436/36
21Accepted3ms5136 KiB
22Accepted3ms5148 KiB
23Accepted3ms5132 KiB
24Accepted3ms5140 KiB
25Accepted3ms5408 KiB
26Accepted3ms5388 KiB
27Accepted3ms5392 KiB
28Accepted3ms5508 KiB
subtask525/25
29Accepted35ms7024 KiB
30Accepted41ms7660 KiB
31Accepted46ms8084 KiB
32Accepted50ms8840 KiB
33Accepted50ms9492 KiB
34Accepted50ms10184 KiB
35Accepted50ms10888 KiB
36Accepted52ms11580 KiB