提出 #686912
ソースコード 拡げる
#include<cstdio>
#include<iostream>
#include<algorithm>
using namespace std;
#define SIZE 30
int A[111][111]={{}};
void hoge(int i,int j,int f){
if(A[i][j]==0) return;
printf("%d %d\n",i+1,j+1);
A[i][j]--;
if( A[i-1][j] == A[i][j] && A[i-1][j]>0 && 0<=i && i<SIZE && 0<=j && j<SIZE) hoge(i-1,j,1);
else if(A[i+1][j] == A[i][j] && A[i+1][j]>0 && 0<=i && i<SIZE && 0<=j && j<SIZE) hoge(i+1,j,1);
else if(A[i][j-1] == A[i][j] && A[i][j-1]>0 && 0<=i && i<SIZE && 0<=j && j<SIZE) hoge(i,j-1,1);
else if(A[i][j+1] == A[i][j] && A[i][j+1]>0 && 0<=i && i<SIZE && 0<=j && j<SIZE) hoge(i,j+1,1);
if(f==1) return;
hoge(i,j,f);
}
int main(){
for(int i=0;i<SIZE;i++){
for(int j=0;j<SIZE;j++){
scanf("%d",&A[i][j]);
}
}
for(int i=0;i<SIZE;i++){
for(int j=0;j<SIZE;j++){
hoge(i,j,0);
}
}
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | A - 高橋君の山崩しゲーム |
| ユーザ | PCBlossoms |
| 言語 | Bash (GNU bash v4.3.11) |
| 得点 | 0 |
| コード長 | 899 Byte |
| 結果 | RE |
| 実行時間 | 10 ms |
| メモリ | 572 KiB |
ジャッジ結果
| セット名 | test_01 | test_02 | test_03 | test_04 | test_05 | test_06 | test_07 | test_08 | test_09 | test_10 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 100000 | 0 / 100000 | 0 / 100000 | 0 / 100000 | 0 / 100000 | 0 / 100000 | 0 / 100000 | 0 / 100000 | 0 / 100000 | 0 / 100000 | ||||||||||||||||||||
| 結果 |
|
|
|
|
|
|
|
|
|
|
| セット名 | テストケース |
|---|---|
| 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 |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| subtask_01_01.txt | RE | 10 ms | 572 KiB |
| subtask_01_02.txt | RE | 10 ms | 568 KiB |
| subtask_01_03.txt | RE | 10 ms | 572 KiB |
| subtask_01_04.txt | RE | 10 ms | 572 KiB |
| subtask_01_05.txt | RE | 10 ms | 572 KiB |
| subtask_01_06.txt | RE | 10 ms | 572 KiB |
| subtask_01_07.txt | RE | 10 ms | 572 KiB |
| subtask_01_08.txt | RE | 10 ms | 572 KiB |
| subtask_01_09.txt | RE | 10 ms | 568 KiB |
| subtask_01_10.txt | RE | 10 ms | 572 KiB |