Submission #48810

#TimeUsernameProblemLanguageResultExecution timeMemory
48810leehosu01여왕벌 (KOI15_queen)C++17
10 / 100
5043 ms44128 KiB
#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)

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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...