結果

問題 No.678 2Dシューティングゲームの必殺ビーム
ユーザー fura
提出日時 2020-05-05 13:51:38
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 454 bytes
コンパイル時間 2,144 ms
コンパイル使用メモリ 195,124 KB
最終ジャッジ日時 2025-01-10 06:45:31
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:27: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         int n,xl,xr; scanf("%d%d%d",&n,&xl,&xr);
      |                      ~~~~~^~~~~~~~~~~~~~~~~~~~~
main.cpp:10:23: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   10 |         rep(i,n) scanf("%d%d%d%d",&l[i],&t[i],&r[i],&b[i]);
      |                  ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int n,xl,xr; scanf("%d%d%d",&n,&xl,&xr);
	vector<int> t(n),b(n),l(n),r(n);
	rep(i,n) scanf("%d%d%d%d",&l[i],&t[i],&r[i],&b[i]);

	vector<bool> flag(n,true);
	for(int x=xl;x<=xr;x++){
		int i0=-1;
		rep(i,n) if(l[i]<=x && x<=r[i]) {
			if(i0==-1 || b[i]>b[i0]) i0=i;
		}
		if(i0!=-1) flag[i0]=false;
	}

	rep(i,n) printf("%d\n",!flag[i]);

	return 0;
}
0