結果

問題 No.182 新規性の虜
ユーザー Maeda
提出日時 2025-03-28 10:16:48
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 643 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 25,984 KB
実行使用メモリ 7,328 KB
最終ジャッジ日時 2025-03-28 10:17:02
合計ジャッジ時間 13,374 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 3 WA * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:6:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%d",&n);
      |     ^~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         scanf("%lld",&selectNum[i]);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
#include <string.h>

void main(void){
    int n = 0;
    scanf("%d",&n);
    long long int selectNum[n] = {};
    int numList[n] = {};
    for(int i = 0 ; i < n ; i++){
        scanf("%lld",&selectNum[i]);
        if(i == 0){
            numList[i]++;
        }else{
            for(int j = 0 ; j < i ; j++){
                if(selectNum[j] == selectNum[i]){
                    numList[j]++;
                    break;
                }
            }
        }  
    }
    int count = 0;
    for(long long int i = 0 ; i < n ; i++){
        if(numList[i] == 1){
            count++;
        }
    }
    printf("%d",count);
}
0