Submission #48810

# Submission time Handle Problem Language Result Execution time Memory
48810 2018-05-19T03:35:59 Z leehosu01 여왕벌 (KOI15_queen) C++17
10 / 100
5000 ms 44128 KB
#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

queen.cpp: In function 'int main()':
queen.cpp:43:13: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
             for(j=0;j<M;j++)
             ^~~
queen.cpp:45:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
                 printf("\n");
                 ^~~~~~
queen.cpp:14:18: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
             scanf("%s",S[i][j]);
             ~~~~~^~~~~~~~~~~~~~
queen.cpp:18:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d%d",&A,&B,&C);
         ~~~~~^~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 484 KB Output is correct
3 Correct 6 ms 1464 KB Output is correct
4 Correct 5 ms 1596 KB Output is correct
5 Correct 32 ms 5368 KB Output is correct
6 Correct 31 ms 5368 KB Output is correct
7 Correct 41 ms 5440 KB Output is correct
8 Correct 79 ms 11588 KB Output is correct
9 Correct 82 ms 11604 KB Output is correct
10 Correct 197 ms 17344 KB Output is correct
11 Correct 157 ms 30820 KB Output is correct
12 Correct 157 ms 44128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 44128 KB Output is correct
2 Execution timed out 5038 ms 44128 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 10 ms 44128 KB Output is correct
2 Correct 923 ms 44128 KB Output is correct
3 Execution timed out 5005 ms 44128 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5027 ms 44128 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 44128 KB Output is correct
2 Correct 2 ms 44128 KB Output is correct
3 Correct 2 ms 44128 KB Output is correct
4 Correct 2 ms 44128 KB Output is correct
5 Correct 291 ms 44128 KB Output is correct
6 Correct 325 ms 44128 KB Output is correct
7 Correct 291 ms 44128 KB Output is correct
8 Correct 295 ms 44128 KB Output is correct
9 Execution timed out 5043 ms 44128 KB Time limit exceeded
10 Halted 0 ms 0 KB -