結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
testcase_03 AC 1 ms
4,380 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 0 ms
4,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
4,376 KB
testcase_13 AC 0 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,376 KB
testcase_18 WA -
testcase_19 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: 関数 ‘main’ 内:
main.c:10:9: 警告: ‘likely’ 属性は無視されました [-Wattributes]
   10 |         if(N % i) [[likely]] continue;
      |         ^~

ソースコード

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) [[likely]] continue;
        cnt = 1;
        do{
            N /= i;
            cnt += 2;
        }while(N % i == 0);
        if(N & 1) ans *= cnt;
    }
    if(N > 1 && N & 1) ans *= 3;
    printf("%u\n", ans - 1);
}
0