結果

問題 No.459 C-VS for yukicoder
ユーザー 👑 kmjpkmjp
提出日時 2016-12-10 00:31:27
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,978 bytes
コンパイル時間 1,653 ms
コンパイル使用メモリ 166,068 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-06 13:42:47
合計ジャッジ時間 6,558 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 2 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 4 ms
5,376 KB
testcase_16 AC 3 ms
5,376 KB
testcase_17 AC 2 ms
5,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 108 ms
5,376 KB
testcase_22 AC 106 ms
5,376 KB
testcase_23 AC 107 ms
5,376 KB
testcase_24 AC 43 ms
5,376 KB
testcase_25 AC 14 ms
5,376 KB
testcase_26 AC 15 ms
5,376 KB
testcase_27 AC 14 ms
5,376 KB
testcase_28 AC 14 ms
5,376 KB
testcase_29 AC 37 ms
5,376 KB
testcase_30 AC 13 ms
5,376 KB
testcase_31 WA -
testcase_32 AC 2 ms
5,376 KB
testcase_33 WA -
testcase_34 AC 29 ms
5,376 KB
testcase_35 AC 3 ms
5,376 KB
testcase_36 AC 31 ms
5,376 KB
testcase_37 AC 3 ms
5,376 KB
testcase_38 WA -
testcase_39 AC 4 ms
5,376 KB
testcase_40 WA -
testcase_41 AC 2 ms
5,376 KB
testcase_42 AC 17 ms
5,376 KB
testcase_43 AC 24 ms
5,376 KB
testcase_44 WA -
testcase_45 AC 5 ms
5,376 KB
testcase_46 AC 4 ms
5,376 KB
testcase_47 AC 2 ms
5,376 KB
testcase_48 AC 25 ms
5,376 KB
testcase_49 AC 2 ms
5,376 KB
testcase_50 WA -
testcase_51 AC 2 ms
5,376 KB
testcase_52 WA -
testcase_53 AC 5 ms
5,376 KB
testcase_54 WA -
testcase_55 AC 9 ms
5,376 KB
testcase_56 WA -
testcase_57 AC 2 ms
5,376 KB
testcase_58 AC 26 ms
5,376 KB
testcase_59 WA -
testcase_60 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#undef _P
#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 ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int H,W,N;
string S;
int HH[10101];

int A[40100][3], C[40101];

void out(int a,int b,int c) {
	string B[3]={"...","...","..."};
	
	if(a>=1) B[0][0]='#';
	if(a>=2) B[1][0]='#';
	if(a>=3) B[2][0]='#';
	if(b>=1) B[0][1]='#';
	if(b>=2) B[1][1]='#';
	if(b>=3) B[2][1]='#';
	if(c>=1) B[0][2]='#';
	if(c>=2) B[1][2]='#';
	if(c>=3) B[2][2]='#';
	cout<<B[0]<<endl;
	cout<<B[1]<<endl;
	cout<<B[2]<<endl;
	
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>H>>W>>N;
	FOR(y,H) {
		cin>>S;
		FOR(x,W) HH[x] += S[x]=='#';
	}
	vector<int> add[10101];
	FOR(i,N) {
		cin>>C[i];
		add[C[i]].push_back(i);
	}
	
	vector<int> Q[5];
	FOR(x,W) {
		FORR(r,Q[4]) Q[1].push_back(r);
		FORR(r,Q[3]) Q[1].push_back(r);
		FORR(r,Q[2]) Q[1].push_back(r);
		Q[4].clear();
		Q[3].clear();
		Q[2].clear();
		FORR(r,add[x]) Q[0].push_back(r);
		
		while(HH[x]) {
			//_P("!! %d %d : %d %d %d %d %d\n",x,HH[x],Q[0].size(),Q[1].size(),Q[2].size(),Q[3].size(),Q[4].size());
			for(i=0;i<=3;i++) {
				//_P("aa %d %d %d %d\n",x,HH[x],i,Q[i].size());
				retry:
				if(Q[i].size()) {
					y=Q[i].back();
					Q[i].pop_back();
					if(x>=C[y]+3) goto retry;
					HH[x]--;
					A[y][x-C[y]]++;
					Q[i+1+(i==0)].push_back(y);
					break;
				}
			}
			//_P("aa %d %d %d %d\n",x,HH[x],4,Q[4].size());
		}
	}
	FOR(i,N) out(A[i][0],A[i][1],A[i][2]);
	
}


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);
	solve(); return 0;
}
0