結果

問題 No.3786 Four Triplets, One Pair
コンテスト
ユーザー arrsty217
提出日時 2026-11-11 20:35:00
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 798µs
コード長 1,457 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,567 ms
コンパイル使用メモリ 343,216 KB
実行使用メモリ 9,872 KB
最終ジャッジ日時 2026-11-11 20:35:06
合計ジャッジ時間 4,990 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using lli=long long int;
using ld=long double;
using vi=vector<int>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vvvvi=vector<vvvi>;
using vl=vector<lli>;
using vvl=vector<vl>;
#define rep(i,s,e) for(int i=s;i<e;i++)
#define rrep(i,s,e) for(int i=s-1;i>=e;i--)
#define veci(v,s) vi v(s); rep(i,0,s) cin >> v.at(i);
#define vecl(v,s) vl v(s); rep(i,0,s) cin >> v.at(i);
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
using pii=pair<int,int>;
using pll=pair<lli,lli>;
#define mp(f,s) make_pair(f,s)
#define fi first
#define se second
using vpii=vector<pii>;
using vpll=vector<pll>;
#define vecpii(v,s) vpii v(s); rep(i,0,s) cin >> v.at(i).fi >> v.at(i).se;
#define vecpll(v,s) vpll v(s); rep(i,0,s) cin >> v.at(i).fi >> v.at(i).se;
#define pub(x) push_back(x)
#define puf(x) push_front(x)
#define pob(x) pop_back(x)
#define pof(x) pop_front(x)
#define eb(x) emplace_back(x)
#define print(s) cout << s << endl;
const int I_INF=1<<30;
const lli LL_INF=1ll<<60;
const string alp="abcdefghijklmnopqrstuvwxyz";
const int let=alp.size(); // 26

int main(){
  vecl(a,13);

  vi cnt(10,0);
  rep(i,0,13) ++cnt[a[i]];

  vi ans;

  rep(d,1,10){
    int three=0,two=0;
    rep(i,1,10){
      int D=cnt[i]+(d==i);
      three+=(D==3);
      two+=(D==2);
    }
    if(three==4 && two==1) ans.push_back(d);
  }

  print(ans.size());
  rep(i,0,ans.size()) cout << ans[i] << " ";
  cout << endl;
}
0