Submission #172972


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("hoge-1,p=%d,q=%d,n=%d\n",p,q,n);
			//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][k]=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 60
Code Size 948 Byte
Status TLE
Exec Time 2051 ms
Memory 131760 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:38:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
./Main.c:39: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 60 / 60 0 / 40
Status
AC × 3
AC × 18
AC × 16
TLE × 4
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 22 ms 680 KB
sample_02.txt AC 20 ms 792 KB
sample_03.txt AC 20 ms 796 KB
subtask1_01.txt AC 20 ms 796 KB
subtask1_02.txt AC 20 ms 920 KB
subtask1_03.txt AC 20 ms 1036 KB
subtask1_04.txt AC 31 ms 5524 KB
subtask1_05.txt AC 21 ms 944 KB
subtask1_06.txt AC 22 ms 2220 KB
subtask1_07.txt AC 43 ms 5032 KB
subtask1_08.txt AC 35 ms 5924 KB
subtask1_09.txt AC 32 ms 5924 KB
subtask1_10.txt AC 49 ms 5924 KB
subtask1_11.txt AC 37 ms 5924 KB
subtask1_12.txt AC 41 ms 5916 KB
subtask1_13.txt AC 41 ms 5924 KB
subtask1_14.txt AC 29 ms 5796 KB
subtask1_15.txt AC 37 ms 5924 KB
subtask2_01.txt AC 20 ms 1556 KB
subtask2_02.txt RE 237 ms 2720 KB
subtask2_03.txt TLE 2051 ms 120748 KB
subtask2_04.txt TLE 2030 ms 3504 KB
subtask2_05.txt TLE 2033 ms 21032 KB
subtask2_06.txt TLE 2041 ms 63276 KB
subtask2_07.txt RE 1318 ms 131752 KB
subtask2_08.txt RE 498 ms 131752 KB
subtask2_09.txt RE 591 ms 131748 KB
subtask2_10.txt RE 581 ms 131756 KB
subtask2_11.txt RE 1289 ms 131752 KB
subtask2_12.txt RE 1283 ms 131756 KB
subtask2_13.txt RE 1673 ms 131752 KB
subtask2_14.txt RE 1653 ms 131760 KB
subtask2_15.txt RE 535 ms 131748 KB