結果

問題 No.29 パワーアップ
ユーザー satanicsatanic
提出日時 2015-11-23 19:58:29
言語 C90
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 443 bytes
コンパイル時間 570 ms
コンパイル使用メモリ 24,048 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-11 18:22:48
合計ジャッジ時間 1,313 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 AC 1 ms
4,352 KB
testcase_05 AC 0 ms
4,348 KB
testcase_06 AC 0 ms
4,352 KB
testcase_07 AC 0 ms
4,348 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 1 ms
4,348 KB
testcase_10 AC 1 ms
4,348 KB
testcase_11 AC 1 ms
4,352 KB
testcase_12 AC 0 ms
4,352 KB
testcase_13 AC 1 ms
4,348 KB
testcase_14 AC 1 ms
4,348 KB
testcase_15 AC 1 ms
4,348 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 0 ms
4,352 KB
testcase_19 AC 1 ms
4,348 KB
testcase_20 AC 1 ms
4,352 KB
testcase_21 AC 0 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

int main(){
  int item[10]={0};
  int n, input;
  int i, j, rest=0;
  int powup_cnt=0;

  scanf("%d", &n);
  for(i=0; i<n; ++i){
    for(j=0; j<3; ++j){
      scanf("%d", &input);
      ++item[input%10];
    }
  }  
  for(i=0; i<10; ++i){
    while(item[i]>=2){
      item[i]-=2;
      ++powup_cnt;
    }
    rest+=item[i];
  }
  while(rest>=4){
    rest-=4;
    ++powup_cnt;
  }
  printf("%d\n", powup_cnt);

  return 0;
}
0