結果

問題 No.1593 Perfect Distance
ユーザー 👑 tatyamtatyam
提出日時 2021-07-09 23:59:48
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 418 bytes
コンパイル時間 1,115 ms
コンパイル使用メモリ 28,520 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-14 11:24:52
合計ジャッジ時間 1,059 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 0 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 WA -
testcase_11 AC 1 ms
4,376 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 1 ms
4,376 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdint.h>

int main(){
    uint32_t N;
    scanf("%u", &N);
    uint32_t ans = 1, cnt;
    while((N & 1) == 0) N >>= 1;
    for(uint32_t i = 3; i <= 447; i += 2){
        if(N % i) continue;
        cnt = 1;
        do{
            N /= i;
            cnt += 2;
        }while(N % i == 0);
        if(N & 2) ans *= cnt;
    }
    if(N > 1 && N & 1) ans *= 3;
    printf("%u\n", ans - 1);
}
0