結果

問題 No.29 パワーアップ
ユーザー hape8810hape8810
提出日時 2019-01-31 12:52:37
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 363 bytes
コンパイル時間 119 ms
使用メモリ 3,112 KB
最終ジャッジ日時 2022-12-15 04:03:18
合計ジャッジ時間 1,446 ms
ジャッジサーバーID
(参考情報)
judge16 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
2,980 KB
testcase_01 AC 1 ms
3,096 KB
testcase_02 AC 1 ms
3,028 KB
testcase_03 AC 1 ms
3,112 KB
testcase_04 AC 1 ms
2,968 KB
testcase_05 AC 2 ms
3,076 KB
testcase_06 AC 1 ms
2,988 KB
testcase_07 AC 1 ms
3,080 KB
testcase_08 AC 2 ms
2,928 KB
testcase_09 AC 2 ms
3,032 KB
testcase_10 AC 2 ms
2,896 KB
testcase_11 AC 1 ms
2,980 KB
testcase_12 AC 1 ms
3,004 KB
testcase_13 AC 2 ms
2,924 KB
testcase_14 AC 1 ms
3,100 KB
testcase_15 AC 1 ms
3,024 KB
testcase_16 AC 1 ms
3,096 KB
testcase_17 AC 2 ms
3,048 KB
testcase_18 AC 1 ms
2,988 KB
testcase_19 AC 1 ms
3,028 KB
testcase_20 AC 2 ms
3,024 KB
testcase_21 AC 2 ms
3,008 KB
権限があれば一括ダウンロードができます

ソースコード

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