14472022-10-10 14:29:44AbbenceHáromszögekcpp17Time limit exceeded 6/40485ms3472 KiB
#include <iostream>
#include <map>

using namespace std;

//nem sajat

int main()
{
    int n,q;
    cin >>n >> q;
    int k[n];
    for(int i=0;i<n;i++)
    {
        cin >> k[i];
    }
    int a, b;
    int n2;
    for(int i=0;i<q;i++)
    {
        cin >> a >> b;
        n2=0;
        for(int j=0;j<n;j++)
        {
            if(k[j]<(a+b) && k[j]>abs(a-b)) n2++;
        }
        cout << n2 << endl;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base6/40
1Accepted0/03ms1880 KiB
2Accepted0/02ms2068 KiB
3Accepted0/0157ms2456 KiB
4Accepted4/48ms2496 KiB
5Accepted2/27ms2732 KiB
6Time limit exceeded0/1485ms2264 KiB
7Time limit exceeded0/1449ms2832 KiB
8Time limit exceeded0/2453ms2736 KiB
9Time limit exceeded0/2453ms2876 KiB
10Time limit exceeded0/1469ms2940 KiB
11Time limit exceeded0/1449ms2868 KiB
12Time limit exceeded0/2458ms3092 KiB
13Time limit exceeded0/2481ms3068 KiB
14Time limit exceeded0/1469ms3068 KiB
15Time limit exceeded0/1470ms3056 KiB
16Time limit exceeded0/1437ms3308 KiB
17Time limit exceeded0/1465ms3472 KiB
18Time limit exceeded0/1469ms3264 KiB
19Time limit exceeded0/2469ms3224 KiB
20Time limit exceeded0/2458ms3340 KiB
21Time limit exceeded0/3469ms3284 KiB
22Time limit exceeded0/5467ms3272 KiB
23Time limit exceeded0/5458ms3216 KiB