結果

問題 No.638 Sum of "not power of 2"
ユーザー Mcpu3
提出日時 2018-09-04 21:19:19
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 294 bytes
コンパイル時間 863 ms
コンパイル使用メモリ 29,184 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-15 19:45:30
合計ジャッジ時間 1,676 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <math.h>

int main(void)
{
    long n,i;
    scanf("%ld",&n);
    if(n-3>2&&n!=7){
        for(i=2;i<60;++i)if((long)pow(2,i)==n-3)break;
        if(i==60)printf("3 %ld",n-3);
        else printf("5 %ld",n-5);
    }
    else puts("-1");
    return 0;
}
0