結果
| 問題 |
No.678 2Dシューティングゲームの必殺ビーム
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-04-27 22:48:12 |
| 言語 | Java (openjdk 23) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,771 bytes |
| コンパイル時間 | 3,881 ms |
| コンパイル使用メモリ | 80,816 KB |
| 実行使用メモリ | 56,164 KB |
| 最終ジャッジ日時 | 2024-06-27 22:05:37 |
| 合計ジャッジ時間 | 7,408 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 11 RE * 7 |
ソースコード
import java.io.*;
import java.util.*;
public class Main_yukicoder678 {
private static Scanner sc;
private static Printer pr;
private static void solve() {
int n = sc.nextInt();
int xlb = sc.nextInt();
int xrb = sc.nextInt();
List<Pair> list = new ArrayList<>(n);
for (int i = 0; i < n; i++) {
int xl = sc.nextInt();
int yu = sc.nextInt();
int xr = sc.nextInt();
int yd = sc.nextInt();
list.add(new Pair(Math.max(0, xl), Math.max(0, yu), xr, yd, i));
}
Collections.sort(list);
int[] ans = new int[n];
boolean[] w = new boolean[1280 + 1];
Arrays.fill(w, true);
for (int i = xlb; i <= xrb; i++) {
w[i] = false;
}
for (int i = list.size() - 1; i >= 0; i--) {
Pair e = list.get(i);
boolean flag = false;
for (int x = e.a; x <= e.c; x++) {
if (!w[x]) {
flag = true;
}
w[x] = true;
}
if (flag) {
ans[e.n] = 1;
} else {
ans[e.n] = 0;
}
}
for (int e : ans) {
pr.println(e);
}
}
static class Pair implements Comparable<Pair> {
int a;
int b;
int c;
int d;
int n;
Pair(int a, int b, int c, int d, int n) {
this.a = a;
this.b = b;
this.c = c;
this.d = d;
this.n = n;
}
@Override
public int compareTo(Pair o) {
if (d == o.d) {
return Integer.compare(c, o.c);
}
return Integer.compare(d, o.d);
}
}
// ---------------------------------------------------
public static void main(String[] args) {
sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
pr = new Printer(System.out);
solve();
// pr.close();
pr.flush();
// sc.close();
}
static String INPUT = null;
private static class Printer extends PrintWriter {
Printer(OutputStream out) {
super(out);
}
}
}