結果

問題 No.29 パワーアップ
ユーザー Yug_min_nullYug_min_null
提出日時 2021-12-14 19:40:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 5,000 ms
コード長 675 bytes
コンパイル時間 2,095 ms
コンパイル使用メモリ 190,492 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-10-01 02:11:39
合計ジャッジ時間 2,932 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,376 KB
testcase_13 AC 1 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,380 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:12: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
    7 | void print(auto a){
      |            ^~~~
main.cpp:11:13: 警告: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’
   11 | void printL(auto a){
      |             ^~~~

ソースコード

diff #

#define _GLIBCXX_DEBUG
#define ll long long
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

void print(auto a){
  cout << a;
}

void printL(auto a){
  cout << a << endl;
}

void fix(int n){
  cout << fixed << setprecision(n);
}

ll RD(ll n, ll m){
  return n/m;
}

void INP(int n, vector<int> &A){
  for(int i = 0; i < 3; i++){
    int a; cin >> a;
    A[a-1]++;
  }
  if(n > 1) INP(n-1, A);
}

void ANS(vector<int> A){
  int ans = 0, mod = 0;
  for(int i = 0; i < (int)A.size(); i++){
    ans += A[i]/2;
    mod += A[i]%2;
  }
  ans += mod/4;
  printL(ans);
}

int main(){
  int N; cin >> N;
  vector<int> A(10, 0);
  INP(N, A);
  ANS(A);
}
0