結果

問題 No.29 パワーアップ
ユーザー hape8810
提出日時 2019-01-31 12:52:37
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 23,040 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-08 20:25:11
合計ジャッジ時間 1,032 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    6 |     scanf("%d",&N);
      |     ~~~~~^~~~~~~~~
main.cpp:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d %d %d",&a,&b,&c);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>
int main(void){
    int N,a,b,c,x;
    int P=0,p=0;
    int I[10]={};
    scanf("%d",&N);
    for(x=0;x<N;x++){
        scanf("%d %d %d",&a,&b,&c);
        I[a-1]++;
        I[b-1]++;
        I[c-1]++;
    }
    for(x=0;x<10;x++){
        P=P+(I[x]/2);
        p=p+(I[x]%2);
    }
    P=P+(p/4);
    
    printf("%d\n",P);
    
    return 0;
}
0