結果
| 問題 |
No.678 2Dシューティングゲームの必殺ビーム
|
| コンテスト | |
| ユーザー |
Esire
|
| 提出日時 | 2018-11-26 19:27:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,406 bytes |
| コンパイル時間 | 923 ms |
| コンパイル使用メモリ | 100,556 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2025-01-02 20:20:15 |
| 合計ジャッジ時間 | 1,814 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 18 |
ソースコード
//g++ -std=c++11 -Wall -O2 -o main.exe main.cpp
//g++ -std=c++14 -Wall -O2 -o main.exe main.cpp
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <functional>
#include <algorithm>
#include <complex>
#include <numeric>
#include <queue>
#include <stack>
#include <tuple>
using namespace std;
#define spc " "
#define MOD 1000000007
typedef long long ll;
typedef long double ld;
typedef pair<int, int> p_ii;
typedef tuple<int, int, int, int> tup;
bool tupComp(tup &t1, tup &t2){
return get<2>(t1) > get<2>(t2);
}
//------------------------------------------------------------------------------
int main(){
int n, xlb, xrb;
cin >> n >> xlb >> xrb;
vector<int> b(1281, 0);
for(int i = xlb; i <= xrb; i++) b[i] = 1;
vector<tup> e;
int t1, t2, t3, t4;
for(int i = 0; i < n; i++){
cin >> t1 >> t2 >> t3 >> t4;
e.push_back( tup(max(1, t1), min(1280, t3), t4, i) );
}
sort(e.begin(), e.end(), tupComp);
int ans;
vector<int> ansv(n);
for(int i = 0; i < n; i++){
ans = 0;
for(int j = get<0>(e[i]); j <= get<1>(e[i]); j++){
if(b[j] == 1){
b[j] = 0;
ans = 1;
}
}
ansv[get<3>(e[i])] = ans;
}
for(int i = 0; i < n; i++) cout << ansv[i] << endl;
return 0;
}
Esire