답안 #155194

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
155194 2019-09-27T03:24:47 Z phillip Uzastopni (COCI17_uzastopni) C++14
48 / 80
263 ms 380 KB
#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;
        }

    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 256 KB Output is correct
4 Correct 10 ms 256 KB Output is correct
5 Correct 21 ms 256 KB Output is correct
6 Correct 132 ms 376 KB Output is correct
7 Incorrect 148 ms 256 KB Output isn't correct
8 Incorrect 172 ms 380 KB Output isn't correct
9 Incorrect 201 ms 368 KB Output isn't correct
10 Incorrect 263 ms 376 KB Output isn't correct