# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
155194 | phillip | Uzastopni (COCI17_uzastopni) | C++14 | 263 ms | 380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,o=1000009;
int main()
{
cin>>n;
for(ll j=1;j<min(n,o);j++)
{
ll i=j;
ll l=i,r=n+1;
while(r-l>1)
{
ll m=(l+r)/2,x=(m*(m+1))/2-(i*(i-1))/2;
if(x==n)
{
cout<<i<<" "<<m<<"\n";
break;
}
else if(x<n)l=m;
else r=m;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |