답안 #68625

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
68625 2018-08-17T16:23:46 Z KLPP 무지개나라 (APIO17_rainbow) C++14
11 / 100
3000 ms 2148 KB
#include "rainbow.h"
#include<iostream>
#include<vector>
#include<queue>
using namespace std;
typedef pair<int,int> pii;
bool table[500][500];
int r,c;
int CC[200000][3];
void init(int R, int C, int sr, int sc, int M, char *S) {
	
	r=R;
	c=C;
	for(int i=0;i<r;i++){
		for(int j=0;j<c;j++)table[i][j]=1;
	}
	int x,y;
	x=sr-1;
	y=sc-1;
	table[x][y]=0;
	for(int i=0;i<M;i++){
		char c=S[i];
		if(c=='N')x--;
		if(c=='S')x++;
		if(c=='E')y++;
		if(c=='W')y--;
		table[x][y]=0;
	}
	/*for(int i=0;i<r;i++){
		for(int j=0;j<c;j++)cout<<table[i][j];
		cout<<endl;
	}*/
	/*if(r==2){
		
	}*/
}

int colour(int ar, int ac, int br, int bc){
	ar--;
	ac--;
	br--;
	bc--;
	bool visited[r][c];
	for(int x=ar;x<=br;x++){
		for(int y=ac;y<=bc;y++){
			visited[x][y]=false;
		}
	}
	int CC=0;
	for(int x=ar;x<=br;x++){
		for(int y=ac;y<=bc;y++){
			if(!visited[x][y] && table[x][y]){
			queue<pii>q;
			q.push(pii(x,y));
			while(!q.empty()){
				pii p=q.front();q.pop();
				if(ar<=p.first && p.first<=br && ac<=p.second && p.second<=bc && !visited[p.first][p.second] && table[p.first][p.second]){
					visited[p.first][p.second]=true;
					q.push(pii(p.first-1,p.second));
					q.push(pii(p.first+1,p.second));
					q.push(pii(p.first,p.second+1));
					q.push(pii(p.first,p.second-1));
				}
			}
			CC++;
			}
		}
	}
	return CC;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 18 ms 744 KB Output is correct
3 Correct 43 ms 744 KB Output is correct
4 Correct 49 ms 744 KB Output is correct
5 Correct 17 ms 744 KB Output is correct
6 Correct 3 ms 744 KB Output is correct
7 Correct 3 ms 744 KB Output is correct
8 Correct 3 ms 744 KB Output is correct
9 Correct 3 ms 744 KB Output is correct
10 Correct 2 ms 744 KB Output is correct
11 Correct 35 ms 744 KB Output is correct
12 Correct 35 ms 820 KB Output is correct
13 Correct 24 ms 820 KB Output is correct
14 Correct 44 ms 832 KB Output is correct
15 Correct 2 ms 832 KB Output is correct
16 Correct 2 ms 832 KB Output is correct
17 Correct 3 ms 832 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 832 KB Output is correct
2 Correct 3 ms 832 KB Output is correct
3 Execution timed out 3036 ms 1696 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 832 KB Output is correct
2 Runtime error 40 ms 1876 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 18 ms 744 KB Output is correct
3 Correct 43 ms 744 KB Output is correct
4 Correct 49 ms 744 KB Output is correct
5 Correct 17 ms 744 KB Output is correct
6 Correct 3 ms 744 KB Output is correct
7 Correct 3 ms 744 KB Output is correct
8 Correct 3 ms 744 KB Output is correct
9 Correct 3 ms 744 KB Output is correct
10 Correct 2 ms 744 KB Output is correct
11 Correct 35 ms 744 KB Output is correct
12 Correct 35 ms 820 KB Output is correct
13 Correct 24 ms 820 KB Output is correct
14 Correct 44 ms 832 KB Output is correct
15 Correct 2 ms 832 KB Output is correct
16 Correct 2 ms 832 KB Output is correct
17 Correct 3 ms 832 KB Output is correct
18 Runtime error 5 ms 2148 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 376 KB Output is correct
2 Correct 18 ms 744 KB Output is correct
3 Correct 43 ms 744 KB Output is correct
4 Correct 49 ms 744 KB Output is correct
5 Correct 17 ms 744 KB Output is correct
6 Correct 3 ms 744 KB Output is correct
7 Correct 3 ms 744 KB Output is correct
8 Correct 3 ms 744 KB Output is correct
9 Correct 3 ms 744 KB Output is correct
10 Correct 2 ms 744 KB Output is correct
11 Correct 35 ms 744 KB Output is correct
12 Correct 35 ms 820 KB Output is correct
13 Correct 24 ms 820 KB Output is correct
14 Correct 44 ms 832 KB Output is correct
15 Correct 2 ms 832 KB Output is correct
16 Correct 2 ms 832 KB Output is correct
17 Correct 3 ms 832 KB Output is correct
18 Runtime error 5 ms 2148 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Halted 0 ms 0 KB -