Submission #1756392
Source Code Expand
#include <iostream> #include <stdio.h> #include <cstring> #include <math.h> #include <algorithm> #include <vector> #include <string> #include <stdlib.h> #include <queue> #include <stack> #include <utility> #include <fstream> #define rep(i,n) for(int i=0;i<n;i++) #define rrep(i,n) for(int i=n-1;i>=0;i--) #define FOR(i,a,b) for(int i=a;i<b;i++) #define ll long long #define INF 1000000001 #define mod 1000000007 #define p pair<int,int> int dx[4]={0,1,0,-1}; int dy[4]={1,0,-1,0}; using namespace std; #define m 30 vector<vector<int>> a(m+2); int x,y; int nall0(void){ FOR(i,1,m+1) FOR(j,1,m+1) if(a[i][j]!=0){ x=i;y=j; return 1; } return 0; } int main(){ rep(i,m+2){ a[i].resize(m+2); rep(j,m+2){ if(i*j==0 || i==m+1 || j==m+1) a[i][j]=0; else cin>>a[i][j]; } } bool re=1; int ans=0; while(nall0()){ re=1; while(re){ re=0; a[x][y]--; printf("%d %d\n",x,y); rep(i,4){ if(a[x+dx[i]][y+dy[i]]==a[x][y] && a[x+dx[i]][y+dy[i]]!=0){ x=x+dx[i],y=y+dy[i]; re=1; break; } } } ans++; } //cout<<ans<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - 高橋君の山崩しゲーム |
User | IHa |
Language | C++14 (GCC 5.4.1) |
Score | 742663 |
Code Size | 1152 Byte |
Status | AC |
Exec Time | 16 ms |
Memory | 512 KB |
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 | 75218 / 100000 | 73519 / 100000 | 74023 / 100000 | 73138 / 100000 | 74454 / 100000 | 74035 / 100000 | 74247 / 100000 | 75730 / 100000 | 74075 / 100000 | 74224 / 100000 | ||||||||||||||||||||
Status |
|
|
|
|
|
|
|
|
|
|
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 | 16 ms | 512 KB |
subtask_01_02.txt | AC | 16 ms | 512 KB |
subtask_01_03.txt | AC | 16 ms | 512 KB |
subtask_01_04.txt | AC | 16 ms | 512 KB |
subtask_01_05.txt | AC | 16 ms | 512 KB |
subtask_01_06.txt | AC | 16 ms | 512 KB |
subtask_01_07.txt | AC | 16 ms | 512 KB |
subtask_01_08.txt | AC | 16 ms | 512 KB |
subtask_01_09.txt | AC | 16 ms | 512 KB |
subtask_01_10.txt | AC | 16 ms | 512 KB |