Submission #172737


Source Code Expand

Copy
#include<stdio.h>
#include<stdlib.h>
#ifndef max
#define max(a,b) (a) > (b) ? (a) : (b)
#endif
#define INF -9999999
//even or odd
void swap(int *a,int *b){
	int *tmp;
	tmp=a;
	a=b;
	b=tmp;
}
short int a[512][512][256];
int r,c,i,j,maxP=INF;

int maxT(int n,int p,int q){
	if(n==0){
		if(maxP<a[p][q][n]){
			maxP=a[p][q][n];
			a[p][q][n]=maxP;
			//printf("maxP=%d\n",maxP);
		}
		return a[p][q][n];
	}
	if(a[p][q][n]>0)return a[p][q][n];
	else{
		if(p-1>=0)a[p-1][q][n-1]=maxT(n-1,p-1,q);
		if(q-1>=0)a[p][q-1][n-1]=maxT(n-1,p,q-1);
		if(p+1<r)a[p+1][q][n-1]=maxT(n-1,p+1,q);
		if(q+1<c)a[p][q+1][n-1]=maxT(n-1,p,q+1);
	}
}
	
int main(){
	int d,k,total;
	scanf("%d %d %d",&r,&c,&d);
	for(i=0;i<r;i++)for(j=0;j<c;j++)scanf("%hd",&a[i][j][0]);
	for(i=0;i<r;i++)for(j=0;j<c;j++)for(k=1;k<d;k++)a[i][j][0]=0;
	maxT(d,0,0);
	printf("%hd\n",maxP);
	return 0;
}
	

Submission Info

Submission Time
Task B - 謎の人物X
User toj210
Language C (GCC 4.6.4)
Score 0
Code Size 901 Byte
Status WA
Exec Time 2047 ms
Memory 131860 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:37:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
./Main.c:38:39: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]

Judge Result

Set Name Sample Subtask1 Subtask2
Score / Max Score 0 / 0 0 / 60 0 / 40
Status
AC × 1
WA × 1
TLE × 1
AC × 2
WA × 1
TLE × 15
AC × 1
TLE × 19
RE × 10
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
Subtask1 sample_01.txt, sample_02.txt, sample_03.txt, subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt
Subtask2 subtask1_01.txt, subtask1_02.txt, subtask1_03.txt, subtask1_04.txt, subtask1_05.txt, subtask1_06.txt, subtask1_07.txt, subtask1_08.txt, subtask1_09.txt, subtask1_10.txt, subtask1_11.txt, subtask1_12.txt, subtask1_13.txt, subtask1_14.txt, subtask1_15.txt, subtask2_01.txt, subtask2_02.txt, subtask2_03.txt, subtask2_04.txt, subtask2_05.txt, subtask2_06.txt, subtask2_07.txt, subtask2_08.txt, subtask2_09.txt, subtask2_10.txt, subtask2_11.txt, subtask2_12.txt, subtask2_13.txt, subtask2_14.txt, subtask2_15.txt
Case Name Status Exec Time Memory
sample_01.txt AC 20 ms 792 KB
sample_02.txt TLE 2029 ms 756 KB
sample_03.txt WA 19 ms 700 KB
subtask1_01.txt AC 19 ms 696 KB
subtask1_02.txt TLE 2028 ms 932 KB
subtask1_03.txt TLE 2030 ms 1200 KB
subtask1_04.txt TLE 2030 ms 5532 KB
subtask1_05.txt TLE 2029 ms 1060 KB
subtask1_06.txt TLE 2029 ms 2336 KB
subtask1_07.txt TLE 2029 ms 5148 KB
subtask1_08.txt TLE 2030 ms 5920 KB
subtask1_09.txt TLE 2030 ms 5932 KB
subtask1_10.txt TLE 2038 ms 6048 KB
subtask1_11.txt TLE 2030 ms 6004 KB
subtask1_12.txt TLE 2029 ms 6052 KB
subtask1_13.txt TLE 2036 ms 6052 KB
subtask1_14.txt TLE 2030 ms 5924 KB
subtask1_15.txt TLE 2030 ms 6052 KB
subtask2_01.txt TLE 2033 ms 1560 KB
subtask2_02.txt RE 254 ms 2848 KB
subtask2_03.txt TLE 2047 ms 120732 KB
subtask2_04.txt TLE 2030 ms 3492 KB
subtask2_05.txt TLE 2033 ms 21016 KB
subtask2_06.txt TLE 2036 ms 63268 KB
subtask2_07.txt RE 1204 ms 131860 KB
subtask2_08.txt RE 500 ms 131752 KB
subtask2_09.txt RE 585 ms 131752 KB
subtask2_10.txt RE 591 ms 131736 KB
subtask2_11.txt RE 1184 ms 131748 KB
subtask2_12.txt RE 1235 ms 131748 KB
subtask2_13.txt RE 1505 ms 131744 KB
subtask2_14.txt RE 1320 ms 131748 KB
subtask2_15.txt RE 520 ms 131700 KB