注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
题目同instant.1point3acres.com/thread/189210#most-old
贴下我的follow up 代码
mport java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.Queue;
public class island_rectangle {
public static class point{ int x; int y; public point(int x, int y){ this.x = x; this.y = y; } } public static void main(String[] args) { if((x==xlen-1 || m[x+1][y]=='O') && (y==ylen-1 || m[x][y+1]=='O') && re.size() ==size){ point p = new point(x,y); re.add(p); } helper(re, x+1, y,m,size); helper(re, x, y+1,m,size); }
}
|