답안 #258077

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
258077 2020-08-05T10:22:43 Z mohammad 무지개나라 (APIO17_rainbow) C++14
0 / 100
3000 ms 21296 KB
#include "rainbow.h"
#include<bits/stdc++.h>
using namespace std;
 
#define endl "\n"
#define OR |
typedef long long ll ;
const ll ooo = 1e14 ;
const ll oo = 2e9 ;
const double PI = acos(-1) ;
const ll M = 1e9 + 7  ;
const int N = 10000010  ;

int r[4] = {1 , -1 , 0 , 0} ,
	c[4] = {0 , 0 , 1 , -1} ;
map<char,int> mp;
string g[52];

void init(int R, int C, int sr, int sc, int M, char *S) {
	mp['N'] = 1;
	mp['S'] = 0;
	mp['E'] = 2;
	mp['W'] = 3;
	for(int i = 1 ; i <= R ; ++i)
		for(int j = 0 ; j <= C ; ++j) g[i] += '.';
	g[sr][sc] = '#';
	for(int i = 0 ; i < M ; ++i){
		sr += r[mp[S[i]]];
		sc += c[mp[S[i]]];
		g[sr][sc] = '#';
	}
}
// 	g++ -Wall -lm -static -DEVAL -o rainbow -O2 rainbow.cpp grader.cpp -std=c++14
int colour(int ar, int ac, int br, int bc) {
	int ans = 0 ;
    for(int i = ar ; i <= br ; ++i)
    	for(int j = ac ; j <= bc ; ++j){
    		if(g[i][j] == '#') continue;
    		bool b = 1 ;
    		if(i != ar && g[i-1][j] == '.') b = 0;
    		if(j != ac && g[i][j-1] == '.') b = 0;
    		ans += b;
    	}
    return ans ;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 256 KB Output is correct
2 Correct 1 ms 256 KB Output is correct
3 Execution timed out 3070 ms 1880 KB Time limit exceeded
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Runtime error 85 ms 21296 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 384 KB Output isn't correct
2 Halted 0 ms 0 KB -