結果
| 問題 | No.29 パワーアップ | 
| コンテスト | |
| ユーザー |  hape8810 | 
| 提出日時 | 2019-01-31 12:52:37 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 1 ms / 5,000 ms | 
| コード長 | 363 bytes | 
| コンパイル時間 | 171 ms | 
| コンパイル使用メモリ | 29,840 KB | 
| 実行使用メモリ | 7,716 KB | 
| 最終ジャッジ日時 | 2025-10-24 21:08:50 | 
| 合計ジャッジ時間 | 994 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| 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);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#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;
}
            
            
            
        