줄기 세포 배양
static class Cell implements Comparable<Cell> { int r, c;// row, col, int life; // 살아있는 시간, int time;// 턴을 확인하기 위한 값 public Cell(int r, int c, int life, int time) { this.r = r; this.c = c; this.life = life; this.time = time; } public int compareTo(Cell o) { if (this.time == o.time) { return Integer.compare(o.life, life); } else { return Integer.compare(this.time, o.time); } } }static class Cell implements Comparable<Cell> { int r, c;// row, col, int life; // 살아있는 시간, int time;// 턴을 확인하기 위한 값 public Cell(int r, int c, int life, int time) { this.r = r; this.c = c; this.life = life; this.time = time; } public int compareTo(Cell o) { if (this.time == o.time) { //return Integer.compare(o.life, life); return o.life-this.life; } else { //return Integer.compare(this.time, o.time); return this.time-o.time; } } }
Last updated