結果
| 問題 | No.904 サメトロ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-24 09:28:51 |
| 言語 | C90 (gcc 15.2.0) |
| 結果 |
RE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 128 bytes |
| 記録 | |
| コンパイル時間 | 310 ms |
| コンパイル使用メモリ | 34,484 KB |
| 最終ジャッジ日時 | 2026-02-24 01:02:24 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 33 |
コンパイルメッセージ
main.c:1:1: warning: data definition has no type or storage class
1 | n,m,c,d,x,y;
| ^
main.c: In function 'main':
main.c:3:15: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
3 | for(gets(&x);~scanf("%d%d",&x,&y);c+=x,d+=y)m=fmax(m,x+y);
| ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
+++ |+#include <stdio.h>
1 | n,m,c,d,x,y;
main.c:5:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
5 | printf("%d\n",d-x+1);
| ^~~~~~
main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf'
/usr/bin/ld: /tmp/ccTotfJX.o: in function `main':
main.c:(.text.startup+0xe): 警告: the `gets' function is dangerous and should not be used.
ソースコード
n,m,c,d,x,y;
main(){
for(gets(&x);~scanf("%d%d",&x,&y);c+=x,d+=y)m=fmax(m,x+y);
x=fmax(0,fmax(d-c,m-c));
printf("%d\n",d-x+1);
}