結果
| 問題 |
No.999 てん vs. ほむ
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2020-10-22 15:22:05 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 4 ms / 2,000 ms |
| コード長 | 281 bytes |
| コンパイル時間 | 108 ms |
| コンパイル使用メモリ | 28,672 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-21 09:18:21 |
| 合計ジャッジ時間 | 947 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
コンパイルメッセージ
main.c:2:1: warning: return type defaults to 'int' [-Wimplicit-int]
2 | main(){
| ^~~~
main.c: In function 'main':
main.c:6:9: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
6 | read(0,r=rbuf,sizeof rbuf);
| ^~~~
main.c:20:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
20 | printf("%ld",b*2-a);
| ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
+++ |+#include <stdio.h>
1 | char rbuf[2000000];
main.c:20:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
20 | printf("%ld",b*2-a);
| ^~~~~~
main.c:20:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
char rbuf[2000000];
main(){
int n,x,y,c;
long a=0,b=0;
char*r;
read(0,r=rbuf,sizeof rbuf);
while(*r++>=48);
while(*r){
x=0;
while(c=*r++,c>=48){
x=x*10+(c-48);
}
y=0;
while(c=*r++,c>=48){
y=y*10+(c-48);
}
a+=x-y;
if(b<a) b=a;
}
printf("%ld",b*2-a);
}
tails