結果
| 問題 |
No.999 てん vs. ほむ
|
| コンテスト | |
| ユーザー |
tails
|
| 提出日時 | 2020-10-22 15:23:30 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 304 bytes |
| コンパイル時間 | 101 ms |
| コンパイル使用メモリ | 28,928 KB |
| 実行使用メモリ | 8,576 KB |
| 最終ジャッジ日時 | 2024-07-21 09:18:22 |
| 合計ジャッジ時間 | 1,109 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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:3:12: warning: implicit declaration of function 'fork' [-Wimplicit-function-declaration]
3 | if(fork()) _exit(0);
| ^~~~
main.c:3:20: warning: implicit declaration of function '_exit'; did you mean '_Exit'? [-Wimplicit-function-declaration]
3 | if(fork()) _exit(0);
| ^~~~~
| _Exit
main.c:7:9: warning: implicit declaration of function 'read' [-Wimplicit-function-declaration]
7 | read(0,r=rbuf,sizeof rbuf);
| ^~~~
main.c:21:9: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
21 | 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:21:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
21 | printf("%ld",b*2-a);
| ^~~~~~
main.c:21:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
char rbuf[2000000];
main(){
if(fork()) _exit(0);
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