Submission #885858

# Submission time Handle Problem Language Result Execution time Memory
885858 2023-12-10T21:59:15 Z MilosMilutinovic Land of the Rainbow Gold (APIO17_rainbow) C++14
0 / 100
3 ms 860 KB
#include "rainbow.h"
#include<bits/stdc++.h>
 
#define pb push_back
#define fi first
#define se second
#define mp make_pair
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
 
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,1:0;}
template <typename T> bool chkmax(T &x,T y){return x<y?x=y,1:0;}
 
int readint(){
	int x=0,f=1; char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
}
 
int mat[55][55];
 
void init(int r,int c,int sc,int sr,int m,char* s){
	mat[sc][sr]=1;
	for(int i=0;i<m;i++){
		if(s[i]=='N') sc--;
		if(s[i]=='S') sc++;
		if(s[i]=='E') sr++;
		if(s[i]=='W') sr--;
		mat[sc][sr]=1;
	}
}
 
int colour(int x1,int y1,int x2,int y2){
	int res=0;
	for(int i=x1;i<=x2;i++) for(int j=y1;j<=y2;j++) res+=1-mat[i][j];
	for(int i=x1;i<=x2;i++) for(int j=y1;j<=y2;j++){
		if(mat[i][j]==1) continue;
		if(i+1<=x2&&mat[i+1][j]==0) res--;
		if(j+1<=y2&&mat[i][j+1]==0) res--;
		if(i+1<=x2&&j+1<=y2&&mat[i+1][j]==0&&mat[i][j+1]==0&&mat[i+1][j+1]==0) res++;
	}
	return res;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Incorrect 3 ms 456 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Runtime error 1 ms 716 KB Execution killed with signal 11
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 600 KB Output is correct
2 Runtime error 1 ms 860 KB Execution killed with signal 11
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Incorrect 3 ms 456 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Incorrect 3 ms 456 KB Output isn't correct
4 Halted 0 ms 0 KB -