Language
C++
Compiler
gcc 12.1.0
Options
Warnings
Don't Use Boost
C++2b(GNU)
-pedantic
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
signed main() {
IOS
int t;
cin >> t;
while (t--)
{
int n,x,count=0;
int a[n];
cout<<"hello";
cin>>n>>x;
for(int i=0;i<n;i++)
{
cin>>a[i];
cout<<"loop";
}
for(int i=0;i<n;i++)
{
cout<<a[i];
}
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
if(a[i]+a[j]<x)
{
count++;
}
}
cout<<count<<endl;
}
}
return 0;
}
1 1 1 1
$ g++ prog.cc -Wall -Wextra -std=gnu++2b -pedantic helloloop10
Exit Code:
0