結果
| 問題 | No.2795 Perfect Number | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-07-07 18:42:25 | 
| 言語 | C (gcc 13.3.0) | 
| 結果 | 
                                RE
                                 
                             | 
| 実行時間 | - | 
| コード長 | 391 bytes | 
| コンパイル時間 | 189 ms | 
| コンパイル使用メモリ | 28,160 KB | 
| 実行使用メモリ | 6,948 KB | 
| 最終ジャッジ日時 | 2024-07-07 18:42:30 | 
| 合計ジャッジ時間 | 3,683 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | RE * 3 | 
| other | AC * 13 WA * 2 RE * 20 | 
ソースコード
#include <stdio.h>
int main(void)
{
    int N, sum=0, count=0;
    int a[100000000];
    
    scanf("%d", &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;
}
            
            
            
        