結果

問題 No.5013 セクスタプル (open)
ユーザー FplusFplusFFplusFplusF
提出日時 2022-12-29 14:25:39
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 5 ms / 2,000 ms
コード長 1,199 bytes
コンパイル時間 2,235 ms
実行使用メモリ 3,592 KB
スコア 8,281
最終ジャッジ日時 2022-12-29 14:25:47
合計ジャッジ時間 7,218 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
using ll=long long;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll,ll>;
const ll INF=(1ll<<60);
template<class T> void chmin(T &a,T b){
    if(a>b){
        a=b;
    }
}
template<class T> void chmax(T &a,T b){
    if(a<b){
        a=b;
    }
}
int to(int i,int j){
    return i*6+j;
}
pair<int,int> back(int x){
    return {x/6,x%6};
}
int d[36][6];
int ans[36];
int main(){
    vector<vector<pair<int,int>>> cnt(6);
    rep(i,36){
        vector<int> cnt_di(6);
        rep(j,6){
            cin >> d[i][j];
            d[i][j]--;
            cnt_di[d[i][j]]++;
        }
        rep(j,6){
            cnt[j].emplace_back(cnt_di[j],i);
        }
    }
    set<int> selected;
    rep(i,6){
        sort(all(cnt[i]));
        reverse(all(cnt[i]));
        int p=0;
        for(auto &[a,b]:cnt[i]){
            if(selected.find(b)!=selected.end()) continue;
            ans[b]=to(i,p);
            selected.insert(b);
            p++;
            if(6<=p) break;
        }
    }
    rep(i,36){
        cout << back(ans[i]).first+1 << " " << back(ans[i]).second+1 << endl;
    }
}
0