結果

問題 No.2795 Perfect Number
ユーザー 2475057t2475057t
提出日時 2024-07-07 18:45:56
言語 C
(gcc 12.3.0)
結果
RE  
実行時間 -
コード長 380 bytes
コンパイル時間 217 ms
コンパイル使用メモリ 28,672 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-07 18:46:02
合計ジャッジ時間 3,799 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 AC 1 ms
5,376 KB
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 WA -
testcase_10 WA -
testcase_11 RE -
testcase_12 AC 1 ms
5,376 KB
testcase_13 AC 1 ms
5,376 KB
testcase_14 AC 1 ms
5,376 KB
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 1 ms
5,376 KB
testcase_18 AC 1 ms
5,376 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 AC 1 ms
5,376 KB
testcase_22 RE -
testcase_23 AC 0 ms
5,376 KB
testcase_24 AC 0 ms
5,376 KB
testcase_25 AC 0 ms
5,376 KB
testcase_26 AC 1 ms
5,376 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 AC 1 ms
5,376 KB
testcase_36 AC 0 ms
5,376 KB
testcase_37 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
int main(void)
{
    int N=0, sum=0, count=0;
    scanf("%d", &N);
    int a[N];
    for(int i=0; i<N; i++){
        if(N%i == 0){
            a[count] = i;
            count++;
        }
    }
    for(int i=0; i<count; i++){
        sum = sum + a[i];
    }
    if(sum == 2*N){
        printf("Yes");
    }
    else{
        printf("No");
    }

    return 0;
}
0