結果

問題 No.29 パワーアップ
ユーザー BantakoBantako
提出日時 2017-06-26 20:30:27
言語 C++11
(gcc 8.5.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 465 bytes
コンパイル時間 130 ms
使用メモリ 3,104 KB
最終ジャッジ日時 2022-11-27 19:29:31
合計ジャッジ時間 1,296 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
2,896 KB
testcase_01 AC 1 ms
3,044 KB
testcase_02 AC 1 ms
2,892 KB
testcase_03 AC 1 ms
3,004 KB
testcase_04 AC 1 ms
2,964 KB
testcase_05 AC 1 ms
2,988 KB
testcase_06 AC 2 ms
2,996 KB
testcase_07 AC 1 ms
2,988 KB
testcase_08 AC 1 ms
2,992 KB
testcase_09 AC 1 ms
2,984 KB
testcase_10 AC 1 ms
2,924 KB
testcase_11 AC 1 ms
2,996 KB
testcase_12 AC 2 ms
3,044 KB
testcase_13 AC 1 ms
2,896 KB
testcase_14 AC 1 ms
2,988 KB
testcase_15 AC 2 ms
3,016 KB
testcase_16 AC 1 ms
2,984 KB
testcase_17 AC 2 ms
3,104 KB
testcase_18 AC 1 ms
3,004 KB
testcase_19 AC 1 ms
2,988 KB
testcase_20 AC 2 ms
2,924 KB
testcase_21 AC 2 ms
2,964 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:2:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
 main(){
      ^

ソースコード

diff #

#include<stdio.h>
main(){
    int N;
    int item[10];
    scanf("%d",&N);
    for(int i = 0;i < 10;i++){
        item[i] = 0;
    }
    for(int i = 0;i < N;i++){
        for(int j = 0;j < 3;j++){
            int a;
            scanf("%d",&a);
            item[a-1]++;
        }
    }
    int rest = 0;
    int lvup = 0;
    for(int i = 0;i < 10;i++){
        lvup += item[i] / 2;
        rest += item[i] % 2;
    }
    lvup += rest / 4;
    printf("%d\n",lvup);
}
0