結果

問題 No.1593 Perfect Distance
ユーザー 👑 tatyamtatyam
提出日時 2021-07-10 00:00:42
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 424 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 28,724 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-14 11:25:17
合計ジャッジ時間 1,154 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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 & 2)) ans *= 3;
    printf("%u\n", ans - 1);
}
0