# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
262472 | 2020-08-13T01:08:54 Z | daniel920712 | 무지개나라 (APIO17_rainbow) | C++14 | 3 ms | 640 KB |
#include "rainbow.h" #include <queue> #include <utility> using namespace std; bool all[55][200005]={0}; bool have[55][200005]={0}; int dx[5]={1,0,-1,0}; int dy[5]={0,-1,0,1}; int con1[200005]; int con2[200005]; int con3[200005]; queue < pair < int , int > > BFS; void init(int R, int C, int sr, int sc, int M, char *S) { all[sr][sc]=1; int i,now1=0,now2=0,now3=0; for(i=0;i<M;i++) { if(S[i]=='N') sr--; if(S[i]=='S') sr++; if(S[i]=='E') sc++; if(S[i]=='W') sc--; all[sr][sc]=1; } for(i=1;i<=C;i++) { if((all[2][i]==0||all[1][i]==0)&&(i==1||(all[2][i-1]==1&&all[1][i-1]==1))) con3[i]=now3++; else con3[i]=con3[i-1]; if((all[1][i]==0)&&(i==1||(all[1][i-1]==1))) con1[i]=now1++; else con1[i]=con1[i-1]; if((all[2][i]==0)&&(i==1||(all[2][i-1]==1))) con2[i]=now2++; else con2[i]=con2[i-1]; } } int colour(int ar, int ac, int br, int bc) { int ans=0,x,y,i,j,k; if(ar==1&&br==1) return con1[bc]-con1[ac]+(all[1][ac]==0); if(ar==2&&br==2) return con2[bc]-con2[ac]+(all[2][ac]==0); return con3[bc]-con3[ac]+((all[1][ac]==0||all[2][ac]==0)); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 384 KB | Output is correct |
2 | Runtime error | 3 ms | 640 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |