Submission #668010


Source Code Expand

#include<stdio.h>

#define map 900

int main(){
	
	int i,j,k;
	int f;
	int A[map];
	int nowi,nowj;
	int n,now,nexti,nextj;
	for(i=0;i<map;i++){
		scanf("%d",&A[i]);
	}
	for(i=0;i<30;i++){
		for(j=0;j<30;j++){
			while(A[i*30+j]>0){
				printf("%d %d\n",i+1,j+1);
				A[i*30+j]--;
				now = A[i*30+j];
				nowi = i;
				nowj = j;
				while(now!=0){
					f = 0;
					if(nowi!=0){
						if(A[(nowi-1)*30+nowj]==now){
							f++;
							nexti = nowi-1;
							nextj = nowj;
						}
					}
					if(nowj!=0){
						if(A[nowi*30+nowj-1]==now){
							f++;
							nexti = nowi;
							nextj = nowj-1;
						}
					}
					if(nowj!=29){
						if(A[nowi*30+nowj+1]==now){
							f++;
							nexti = nowi;
							nextj = nowj+1;
						}
					}
					if(nowi!=29){
						if(A[(nowi+1)*30+nowj]==now){
							f++;
							nexti = nowi+1;
							nextj = nowj;
						}
					}
					if(f == 0){
						break;
					}else{
						printf("%d %d\n",nexti+1,nextj+1);
						A[nexti*30+nextj]--;
						now = A[nexti*30+nextj];
						nowi = nexti;
						nowj = nextj;
					}
				}
			}
			
		}
	}
	
	
	return 0;
}

Submission Info

Submission Time
Task A - 高橋君の山崩しゲーム
User jango
Language C (GCC 5.4.1)
Score 736168
Code Size 1153 Byte
Status AC
Exec Time 16 ms
Memory 384 KB

Compile Error

./Main.c: In function ‘main’:
./Main.c:13:3: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d",&A[i]);
   ^

Judge Result

Set Name test_01 test_02 test_03 test_04 test_05 test_06 test_07 test_08 test_09 test_10
Score / Max Score 74511 / 100000 72603 / 100000 73563 / 100000 72129 / 100000 74188 / 100000 73567 / 100000 73655 / 100000 75019 / 100000 73372 / 100000 73561 / 100000
Status
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
AC × 1
Set Name Test Cases
test_01 subtask_01_01.txt
test_02 subtask_01_02.txt
test_03 subtask_01_03.txt
test_04 subtask_01_04.txt
test_05 subtask_01_05.txt
test_06 subtask_01_06.txt
test_07 subtask_01_07.txt
test_08 subtask_01_08.txt
test_09 subtask_01_09.txt
test_10 subtask_01_10.txt
Case Name Status Exec Time Memory
subtask_01_01.txt AC 13 ms 384 KB
subtask_01_02.txt AC 14 ms 384 KB
subtask_01_03.txt AC 13 ms 384 KB
subtask_01_04.txt AC 14 ms 384 KB
subtask_01_05.txt AC 13 ms 384 KB
subtask_01_06.txt AC 16 ms 384 KB
subtask_01_07.txt AC 13 ms 384 KB
subtask_01_08.txt AC 13 ms 384 KB
subtask_01_09.txt AC 13 ms 384 KB
subtask_01_10.txt AC 13 ms 384 KB