結果

問題 No.893 お客様を誘導せよ
ユーザー ateate
提出日時 2019-11-06 14:03:14
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 505 bytes
コンパイル時間 2,425 ms
コンパイル使用メモリ 208,380 KB
実行使用メモリ 4,604 KB
最終ジャッジ日時 2023-10-13 02:36:15
合計ジャッジ時間 3,836 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 6 ms
4,348 KB
testcase_03 AC 19 ms
4,348 KB
testcase_04 AC 19 ms
4,356 KB
testcase_05 AC 18 ms
4,352 KB
testcase_06 AC 13 ms
4,352 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 39 ms
4,604 KB
testcase_09 AC 2 ms
4,352 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 2 ms
4,352 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:6:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    6 | main(){
      | ^~~~

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<(n);++i)

main(){

  ll n;
  cin>>n;
  vector<ll> p(n);
  vector<vector<ll>> a(n);
  rep(i,n){
    cin>>p[i];
    a[i].resize(p[i]);
    rep(j,p[i])cin>>a[i][j];
  }

  vector<vector<ll>> x(*max_element(p.begin(),p.end()));
  rep(i,n){
    rep(j,p[i])x[j].emplace_back(a[i][j]);
  }

  for(auto& v:x)sort(v.begin(),v.end());

  for(auto y:x){
    for(auto x:y){
      cout<<x<<" ";
    }
  }
  cout<<endl;

}
0