結果
問題 | No.678 2Dシューティングゲームの必殺ビーム |
ユーザー | ats5515 |
提出日時 | 2018-04-27 22:42:47 |
言語 | C++11 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 936 bytes |
コンパイル時間 | 770 ms |
コンパイル使用メモリ | 90,368 KB |
実行使用メモリ | 4,384 KB |
最終ジャッジ日時 | 2023-09-10 06:33:03 |
合計ジャッジ時間 | 1,690 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,376 KB |
testcase_02 | AC | 2 ms
4,384 KB |
testcase_03 | AC | 2 ms
4,376 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 2 ms
4,380 KB |
testcase_06 | AC | 2 ms
4,376 KB |
testcase_07 | AC | 1 ms
4,380 KB |
testcase_08 | AC | 1 ms
4,376 KB |
testcase_09 | AC | 2 ms
4,376 KB |
testcase_10 | AC | 2 ms
4,380 KB |
testcase_11 | AC | 2 ms
4,380 KB |
testcase_12 | AC | 2 ms
4,380 KB |
testcase_13 | AC | 2 ms
4,376 KB |
testcase_14 | AC | 2 ms
4,380 KB |
testcase_15 | AC | 2 ms
4,380 KB |
testcase_16 | AC | 2 ms
4,376 KB |
testcase_17 | AC | 2 ms
4,380 KB |
ソースコード
#include <iostream> #include <vector> #include <map> #include <set> #include <queue> #include <string> #include <iomanip> #include <algorithm> #include <cmath> #include <stdio.h> using namespace std; #define int long long int MOD = 1000000007; struct Rect { int l, u, r, d, ind; bool operator<(const Rect& right) const { return d > right.d; } }; signed main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; int L, R; cin >> L >> R; vector<Rect> rect(N); for (int i = 0; i < N; i++) { cin >> rect[i].l >> rect[i].u >> rect[i].r >> rect[i].d; rect[i].ind = i; } sort(rect.begin(), rect.end()); set<int> ng; for (int i = L; i <= R; i++) { ng.insert(i); } vector<int> res(N, 0); for (int i = 0; i < N; i++) { for (int j = rect[i].l; j <= rect[i].r; j++) { if (ng.count(j) == 1) { res[rect[i].ind] = 1; ng.erase(j); } } } for (int i = 0; i < N; i++) { cout << res[i] << endl; } }