結果

問題 No.1910 High Element on Grid
ユーザー 👑 kmjpkmjp
提出日時 2022-04-23 19:20:59
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 1,204 bytes
コンパイル時間 2,241 ms
コンパイル使用メモリ 199,548 KB
実行使用メモリ 10,440 KB
最終ジャッジ日時 2023-09-07 11:13:43
合計ジャッジ時間 9,820 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
9,364 KB
testcase_01 AC 5 ms
9,636 KB
testcase_02 AC 5 ms
9,380 KB
testcase_03 AC 4 ms
9,340 KB
testcase_04 AC 5 ms
9,372 KB
testcase_05 AC 5 ms
9,456 KB
testcase_06 AC 5 ms
9,352 KB
testcase_07 AC 5 ms
9,412 KB
testcase_08 AC 5 ms
9,536 KB
testcase_09 AC 5 ms
9,376 KB
testcase_10 AC 5 ms
9,368 KB
testcase_11 AC 18 ms
10,216 KB
testcase_12 AC 19 ms
10,168 KB
testcase_13 AC 19 ms
10,264 KB
testcase_14 AC 21 ms
10,352 KB
testcase_15 AC 16 ms
10,004 KB
testcase_16 AC 15 ms
10,020 KB
testcase_17 AC 15 ms
9,984 KB
testcase_18 AC 18 ms
10,292 KB
testcase_19 AC 15 ms
10,080 KB
testcase_20 AC 16 ms
10,316 KB
testcase_21 AC 17 ms
10,124 KB
testcase_22 AC 13 ms
10,336 KB
testcase_23 AC 19 ms
10,240 KB
testcase_24 AC 14 ms
10,084 KB
testcase_25 AC 18 ms
10,240 KB
testcase_26 AC 17 ms
10,212 KB
testcase_27 AC 17 ms
10,288 KB
testcase_28 AC 12 ms
9,984 KB
testcase_29 AC 14 ms
10,140 KB
testcase_30 AC 15 ms
10,316 KB
testcase_31 AC 5 ms
9,336 KB
testcase_32 AC 23 ms
10,344 KB
testcase_33 AC 23 ms
10,344 KB
testcase_34 AC 23 ms
10,388 KB
testcase_35 AC 23 ms
10,440 KB
testcase_36 AC 5 ms
9,564 KB
testcase_37 AC 14 ms
10,020 KB
testcase_38 AC 9 ms
10,036 KB
testcase_39 AC 8 ms
9,676 KB
testcase_40 AC 5 ms
9,576 KB
testcase_41 AC 10 ms
10,436 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------

int H,W;
int R[505];
int C[505];
int A[505][505];

vector<int> E[505][505];
int in[505][505];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>H>>W;
	FOR(y,H) cin>>R[y];
	FOR(x,W) cin>>C[x];
	
	FOR(y,H) FOR(x,W) A[y][x]=y+x+2;
	A[0][0]=100000;
	for(y=1;y<H;y++) A[y][0]=A[y][W-R[y]];
	for(x=1;x<W;x++) A[0][x]=A[H-C[x]][x];
	
	
	
	
	FOR(y,H) {
		FOR(x,W) cout<<A[y][x]<<" ";
		cout<<endl;
	}
	
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0