結果
問題 | No.678 2Dシューティングゲームの必殺ビーム |
ユーザー | %20 |
提出日時 | 2018-04-27 23:44:47 |
言語 | C (gcc 12.3.0) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 205 ms |
コンパイル使用メモリ | 30,464 KB |
実行使用メモリ | 9,088 KB |
最終ジャッジ日時 | 2024-06-27 22:30:08 |
合計ジャッジ時間 | 992 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
5,248 KB |
testcase_01 | AC | 3 ms
5,376 KB |
testcase_02 | AC | 3 ms
5,376 KB |
testcase_03 | AC | 3 ms
5,376 KB |
testcase_04 | AC | 5 ms
5,376 KB |
testcase_05 | AC | 8 ms
5,376 KB |
testcase_06 | AC | 10 ms
5,376 KB |
testcase_07 | AC | 6 ms
5,376 KB |
testcase_08 | AC | 13 ms
5,376 KB |
testcase_09 | AC | 7 ms
5,376 KB |
testcase_10 | AC | 4 ms
5,888 KB |
testcase_11 | AC | 12 ms
5,376 KB |
testcase_12 | AC | 12 ms
5,376 KB |
testcase_13 | AC | 8 ms
6,784 KB |
testcase_14 | AC | 13 ms
7,680 KB |
testcase_15 | AC | 8 ms
9,088 KB |
testcase_16 | AC | 7 ms
5,376 KB |
testcase_17 | AC | 7 ms
5,504 KB |
コンパイルメッセージ
main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:4:9: warning: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%d%d%d",&N,&L,&R); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int m[2181][1281],f[189]; main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%d%d%d",&N,&L,&R); | ^~~~~ main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:8:19: warning: implicit declaration of function 'fmax' [-Wimplicit-function-declaration] 8 | l=fmax(0,l); | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'fmax' +++ |+#include <math.h> 1 | int m[2181][1281],f[189]; main.c:8:19: warning: incompatible implicit declaration of built-in function 'fmax' [-Wbuiltin-declaration-mismatch] 8 | l=fmax(0,l); | ^~~~ main.c:8:19: note: include '<math.h>' or provide a declaration of 'fmax' main.c:10:19: warning: implicit declaration of function 'fmin' [-Wimplicit-function-declaration] 10 | r=fmin(r,R); | ^~~~ main.c:10:19: note: include '<math.h>' or provide a declaration of 'fmin' main.c:10:19: warning: incompatible implicit declaration of built-in function 'fmin' [-Wbuiltin-declaration-mismatch] main.c:10:19: note: include '<math.h>' or provide a declaration of 'fmin' main.c:26:17: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 26 | printf("%d\n",f[i]); | ^~~~~~ main.c:26:17: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:26:17: warning: incompatible implicit declaration of built-in function 'printf' [
ソースコード
int m[2181][1281],f[189]; main(){ int N,L,R; scanf("%d%d%d",&N,&L,&R); for(int i=1;i<=N;++i){ int l,u,r,d; scanf("%d%d%d%d",&l,&u,&r,&d); l=fmax(0,l); u=fmax(0,u); r=fmin(r,R); for(int y=u;y<=d;++y){ for(int x=l;x<=r;++x){ m[y][x]=i; } } } for(int x=L;x<=R;++x){ for(int y=2180;y>=0;--y){ if(m[y][x]){ f[m[y][x]]|=1; break; } } } for(int i=1;i<=N;++i){ printf("%d\n",f[i]); } }