TRICOIN - Editorial

to get complete AC you can use this code:
// here we are just soliving the quadratic equation H^2 + H -2*N <= 0;

#include
#include <math.h>
using namespace std;

int main() {
// your code goes here
int t,i;
cin>>t;
if(t>100) goto ends;
for(i=0;i<t;i++)
{
long int N,j,ctr;
long long int sum=0;
ctr=0;
sum=0;
cin>>N;
ctr= (-1+sqrt(1+8*N))/2;
cout<<ctr<<"\n";
}
ends:
return 0;
}

#include
using namespace std;
int main()
{
int T;
long long int N;
cin>>T;
while (T–)
{
cin>>N;
if (N%3==0)
cout<<(N/3)+1<<endl;
else
cout<<(N/3)+1<<endl;

}
return 0;

}

can anyone please help that why i haven’t pass any of the test cases even my ans is correct??
SOMEONE HELP!!!

What’s the error in my code?
I am getting error in subtask 1 - task 1
and subtask 2 - task 1 only
rest is correct

#include <stdio.h>

int main(void) {
int t;
scanf("%d",&t);
while(t–)
{
long long int n;
scanf("%lld", &n);
long long int i, sum=0;
for(i=1; i<=n; i++)
{
sum += i;
if(sum > n)
{
i–;
break;
}
}
printf("%lld\n", i);
}
return 0;
}

Another Approch.

 int n;
    cin >> n;
    int height = 0;

    for (int i = 1; i < 100000; i++)
    {
        if (n-i >= 0)
        {
            n -= i;
            height++;
        }
        else
        {
            break;
        }
        
    }
    cout << height << endl;

In its TAG it says Binary search but I find it not linked to it in anyway. Can someone explain me if I’m wrong?

tq bro

plz send me the code of this