# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
48810 | leehosu01 | 여왕벌 (KOI15_queen) | C++17 | 5043 ms | 44128 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int M,N;
#define L DT[i][j-1]
#define U DT[i-1][j]
#define D DT[i-1][j-1]
char S[700][700][28],DT[700][700];
int mat[700][700];
int main()
{
cin>>M>>N;int i,j,t;
for(i=1;i<M;i++)
for(j=1;j<M;j++)
scanf("%s",S[i][j]);
int A,B,C;
for(t=0;t<N;t++)
{
scanf("%d%d%d",&A,&B,&C);
for(i=M-1;i>=0;i--)
{
if(A)DT[i][0]=0,--A;
else if(B)mat[i][0]+=(DT[i][0]=1),--B;
else if(C)mat[i][0]+=(DT[i][0]=2),--C;
}
for(i=1;i<M;i++)
{
if(A)DT[0][i]=0,--A;
else if(B)mat[0][i]+=(DT[0][i]=1),--B;
else if(C)mat[0][i]+=(DT[0][i]=2),--C;
}char T;
for(i=1;i<M;i++)
{
for(j=1;j<M;j++)
{
T=S[i][j][L *9+D *3+ U];
mat[i][j]+=(DT[i][j]=(T=='L'?L:T=='U'?U:D));
}
}
}
for(i=0;i<M;i++)
{
for(j=0;j<M;j++)
printf("%d ",mat[i][j]+1);
printf("\n");
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |