# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
152365 | sofhiasouza | Uzastopni (COCI17_uzastopni) | C++14 | 38 ms | 504 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>
using namespace std;
typedef long long int ll;
const int maxi = 2e5;
int main()
{
ll n;
cin >> n;
for(int i = 2 ; i <= maxi and i <= n ; i++)
{
ll ini = i, fim = n;
while(ini <= fim)
{
ll meio = (ini+fim)/2;
double r = (meio+(meio-i+1))*i/2;
if(r == n)
{
cout << meio-i+1 << ' ' << meio << "\n";
break;
}
else if(r < n) ini = meio+1;
else fim = meio-1;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |