提出 #19825009


ソースコード 拡げる

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n,ans=0;
    cin>>n;
    for (ll i=1;i*i<=2*n;++i)
    {
        if ((2*n)%i==0)
        {
            if (((2*n/i)-i+1)%2==0)
                ++ans;
            if (i*i!=2*n&&(i-(2*n/i)+1)%2==0)
                ++ans;
        }
    }
    cout<<ans;
    return 0;
}

提出情報

提出日時
問題 D - Staircase Sequences
ユーザ ScarletS
言語 C++ (GCC 9.2.1)
得点 400
コード長 420 Byte
結果 AC
実行時間 25 ms
メモリ 3644 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 3
AC × 33
セット名 テストケース
Sample 01_sample.txt, 02_sample.txt, 03_sample.txt
All 01_sample.txt, 02_sample.txt, 03_sample.txt, 04_hand.txt, 05_hand.txt, 06_hand.txt, 07_small.txt, 08_small.txt, 09_small.txt, 10_small.txt, 11_small.txt, 12_large.txt, 13_large.txt, 14_large.txt, 15_large.txt, 16_large.txt, 17_large.txt, 18_large.txt, 19_large.txt, 20_power.txt, 21_power.txt, 22_power.txt, 23_power.txt, 24_power.txt, 25_power.txt, 26_power.txt, 27_power.txt, 28_power.txt, 29_power.txt, 30_prod.txt, 31_prod.txt, 32_prod.txt, 33_prod.txt
ケース名 結果 実行時間 メモリ
01_sample.txt AC 9 ms 3524 KiB
02_sample.txt AC 2 ms 3572 KiB
03_sample.txt AC 22 ms 3464 KiB
04_hand.txt AC 22 ms 3588 KiB
05_hand.txt AC 18 ms 3584 KiB
06_hand.txt AC 25 ms 3524 KiB
07_small.txt AC 2 ms 3512 KiB
08_small.txt AC 2 ms 3592 KiB
09_small.txt AC 3 ms 3464 KiB
10_small.txt AC 3 ms 3596 KiB
11_small.txt AC 5 ms 3536 KiB
12_large.txt AC 4 ms 3516 KiB
13_large.txt AC 3 ms 3560 KiB
14_large.txt AC 5 ms 3512 KiB
15_large.txt AC 3 ms 3536 KiB
16_large.txt AC 2 ms 3564 KiB
17_large.txt AC 3 ms 3600 KiB
18_large.txt AC 5 ms 3532 KiB
19_large.txt AC 2 ms 3512 KiB
20_power.txt AC 17 ms 3480 KiB
21_power.txt AC 10 ms 3516 KiB
22_power.txt AC 13 ms 3560 KiB
23_power.txt AC 3 ms 3620 KiB
24_power.txt AC 2 ms 3588 KiB
25_power.txt AC 18 ms 3588 KiB
26_power.txt AC 15 ms 3644 KiB
27_power.txt AC 2 ms 3564 KiB
28_power.txt AC 8 ms 3508 KiB
29_power.txt AC 5 ms 3488 KiB
30_prod.txt AC 24 ms 3580 KiB
31_prod.txt AC 20 ms 3592 KiB
32_prod.txt AC 19 ms 3524 KiB
33_prod.txt AC 17 ms 3572 KiB