結果

問題 No.893 お客様を誘導せよ
ユーザー magmag
提出日時 2020-06-19 06:18:13
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 18 ms / 2,000 ms
コード長 904 bytes
コンパイル時間 1,702 ms
コンパイル使用メモリ 168,940 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-16 12:36:27
合計ジャッジ時間 2,474 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 4 ms
4,380 KB
testcase_03 AC 9 ms
4,380 KB
testcase_04 AC 9 ms
4,380 KB
testcase_05 AC 9 ms
4,380 KB
testcase_06 AC 6 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 18 ms
4,376 KB
testcase_09 AC 3 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>

using namespace std;
using ll=long long;
#define rep2(i, a, n) for(int i = (a); i < (n); i++)
#define rep(i, n) rep2(i,0,n)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  int n;cin>>n;
  vector<vector<int>> vec(n,vector<int>(101,0));
  int p,a[n];
  rep(i,n){
    cin>>p;
    a[i]=p;
    rep(j,p){
      cin>>vec[i][j];
    }
  } 
  //$BM6F3$O0J2<$N%k!<%k$K4p$E$$$F9T$o$l$^$9!#(B
	//1 $BA`:n!'$"$k%l%8$K$D$$$F!"$=$N%l%8$KJB$V@hF,$N$*5RMM$r?M$N<j$G@:;;$r9T$&(B
  //$B%l%8$N:G8eHx$KM6F3$9$k!#$3$l$K$h$j!"#2HVL\$N$*5RMM$,@hF,$K$J$k!#(B
	//2$BA`:n$r!"%l%8HV9f$N<c$$=g$K9T$&!#%l%8HV9f(B N $B$^$G=*$o$l$P!"$^$?(B1$B$KLa$k(B
	//3$B0J>e$rA4$F$N$*5RMM$,0\F0$7=*$o$k$^$G9T$&!#(B
  int j=0,cnt;
  while(1){
    cnt=0;
    rep(i,n){
      if(j<a[i])cout<<vec[i][j]<<" ";
      else if(j>=a[i])cnt++;
    }
    j++;
    if(cnt==n)break;
  }
  cout<<endl;
}
0