結果
問題 | No.1593 Perfect Distance |
ユーザー |
![]() |
提出日時 | 2021-07-10 00:01:40 |
言語 | C (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 424 bytes |
コンパイル時間 | 230 ms |
コンパイル使用メモリ | 29,696 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-01 18:55:36 |
合計ジャッジ時間 | 906 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#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(!(i & 2)) ans *= cnt;}if(N > 1 && !(N & 2)) ans *= 3;printf("%u\n", ans - 1);}