結果

問題 No.1593 Perfect Distance
ユーザー 👑 tatyam
提出日時 2021-07-09 23:59:48
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 418 bytes
コンパイル時間 1,372 ms
コンパイル使用メモリ 29,440 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-01 18:54:15
合計ジャッジ時間 938 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 9 WA * 8
権限があれば一括ダウンロードができます

ソースコード

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