提出 #68771324


ソースコード 拡げる

#include <bits/stdc++.h>
#include <bits/extc++.h>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
const int maxn=2e5+5;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    long long x;
    cin>>x;
    long long xx=4*x-1;
    vector<long long> ans;
    for (long long i=1;i*i<=abs(xx);i++)
    {
        if (xx%i==0)
        {
            long long tmp=xx/i-i;
            if (tmp%2==0)
            {
                tmp/=2;
                if (tmp%2)
                {
                    ans.push_back((-1-tmp)/2);
                    ans.push_back((-1+tmp)/2);
                }
            }
        }
    }
    sort(ans.begin(),ans.end());
    int nn=unique(ans.begin(),ans.end())-ans.begin();
    ans.resize(nn);
    cout<<ans.size()<<'\n';
    for (auto i:ans)
        cout<<i<<' ';
}

提出情報

提出日時
問題 G - sqrt(n²+n+X)
ユーザ Alliy666
言語 C++ 23 (gcc 12.2)
得点 575
コード長 900 Byte
結果 AC
実行時間 59 ms
メモリ 3580 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 575 / 575
結果
AC × 3
AC × 63
セット名 テストケース
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_handmade_00.txt, 01_handmade_01.txt, 01_handmade_02.txt, 01_handmade_03.txt, 01_handmade_04.txt, 01_handmade_05.txt, 01_handmade_06.txt, 01_handmade_07.txt, 01_handmade_08.txt, 01_handmade_09.txt, 01_handmade_10.txt, 01_handmade_11.txt, 01_handmade_12.txt, 01_handmade_13.txt, 01_handmade_14.txt, 01_handmade_15.txt, 01_handmade_16.txt, 01_handmade_17.txt, 01_handmade_18.txt, 01_handmade_19.txt, 01_handmade_20.txt, 01_handmade_21.txt, 01_handmade_22.txt, 01_handmade_23.txt, 01_handmade_24.txt, 01_handmade_25.txt, 01_handmade_26.txt, 01_handmade_27.txt, 01_handmade_28.txt, 01_handmade_29.txt, 01_handmade_30.txt, 01_handmade_31.txt, 01_handmade_32.txt, 01_handmade_33.txt, 01_handmade_34.txt, 01_handmade_35.txt, 01_handmade_36.txt, 01_handmade_37.txt, 01_handmade_38.txt, 01_handmade_39.txt, 01_handmade_40.txt, 01_handmade_41.txt, 01_handmade_42.txt, 01_handmade_43.txt, 01_handmade_44.txt, 01_handmade_45.txt, 01_handmade_46.txt, 01_handmade_47.txt, 01_handmade_48.txt, 01_handmade_49.txt, 02_radom_00.txt, 02_radom_01.txt, 02_radom_02.txt, 02_radom_03.txt, 02_radom_04.txt, 02_radom_05.txt, 02_radom_06.txt, 02_radom_07.txt, 02_radom_08.txt, 02_radom_09.txt
ケース名 結果 実行時間 メモリ
00_sample_00.txt AC 1 ms 3348 KiB
00_sample_01.txt AC 1 ms 3516 KiB
00_sample_02.txt AC 1 ms 3332 KiB
01_handmade_00.txt AC 1 ms 3412 KiB
01_handmade_01.txt AC 1 ms 3372 KiB
01_handmade_02.txt AC 1 ms 3468 KiB
01_handmade_03.txt AC 1 ms 3336 KiB
01_handmade_04.txt AC 1 ms 3528 KiB
01_handmade_05.txt AC 1 ms 3440 KiB
01_handmade_06.txt AC 1 ms 3440 KiB
01_handmade_07.txt AC 1 ms 3336 KiB
01_handmade_08.txt AC 1 ms 3468 KiB
01_handmade_09.txt AC 1 ms 3348 KiB
01_handmade_10.txt AC 1 ms 3372 KiB
01_handmade_11.txt AC 1 ms 3456 KiB
01_handmade_12.txt AC 1 ms 3520 KiB
01_handmade_13.txt AC 1 ms 3348 KiB
01_handmade_14.txt AC 1 ms 3452 KiB
01_handmade_15.txt AC 1 ms 3396 KiB
01_handmade_16.txt AC 1 ms 3436 KiB
01_handmade_17.txt AC 1 ms 3464 KiB
01_handmade_18.txt AC 1 ms 3436 KiB
01_handmade_19.txt AC 1 ms 3376 KiB
01_handmade_20.txt AC 1 ms 3344 KiB
01_handmade_21.txt AC 59 ms 3372 KiB
01_handmade_22.txt AC 46 ms 3352 KiB
01_handmade_23.txt AC 48 ms 3580 KiB
01_handmade_24.txt AC 24 ms 3336 KiB
01_handmade_25.txt AC 32 ms 3524 KiB
01_handmade_26.txt AC 48 ms 3460 KiB
01_handmade_27.txt AC 59 ms 3348 KiB
01_handmade_28.txt AC 59 ms 3332 KiB
01_handmade_29.txt AC 59 ms 3368 KiB
01_handmade_30.txt AC 59 ms 3520 KiB
01_handmade_31.txt AC 59 ms 3464 KiB
01_handmade_32.txt AC 59 ms 3524 KiB
01_handmade_33.txt AC 59 ms 3396 KiB
01_handmade_34.txt AC 59 ms 3372 KiB
01_handmade_35.txt AC 59 ms 3400 KiB
01_handmade_36.txt AC 59 ms 3340 KiB
01_handmade_37.txt AC 59 ms 3336 KiB
01_handmade_38.txt AC 59 ms 3580 KiB
01_handmade_39.txt AC 59 ms 3580 KiB
01_handmade_40.txt AC 59 ms 3336 KiB
01_handmade_41.txt AC 59 ms 3376 KiB
01_handmade_42.txt AC 59 ms 3440 KiB
01_handmade_43.txt AC 59 ms 3344 KiB
01_handmade_44.txt AC 59 ms 3524 KiB
01_handmade_45.txt AC 59 ms 3356 KiB
01_handmade_46.txt AC 59 ms 3428 KiB
01_handmade_47.txt AC 59 ms 3468 KiB
01_handmade_48.txt AC 59 ms 3468 KiB
01_handmade_49.txt AC 50 ms 3568 KiB
02_radom_00.txt AC 51 ms 3440 KiB
02_radom_01.txt AC 44 ms 3464 KiB
02_radom_02.txt AC 23 ms 3440 KiB
02_radom_03.txt AC 56 ms 3460 KiB
02_radom_04.txt AC 56 ms 3344 KiB
02_radom_05.txt AC 43 ms 3396 KiB
02_radom_06.txt AC 38 ms 3452 KiB
02_radom_07.txt AC 30 ms 3384 KiB
02_radom_08.txt AC 44 ms 3468 KiB
02_radom_09.txt AC 52 ms 3336 KiB