結果
| 問題 | No.1037 exhausted |
| コンテスト | |
| ユーザー |
👑 tails
|
| 提出日時 | 2021-01-05 21:33:50 |
| 言語 | C(gnu17) (gcc 15.2.0) |
| 結果 |
CE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 522 bytes |
| 記録 | |
| コンパイル時間 | 204 ms |
| コンパイル使用メモリ | 28,540 KB |
| 最終ジャッジ日時 | 2026-02-22 06:37:52 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
コンパイルエラー時のメッセージ・ソースコードは、提出者また管理者しか表示できないようにしております。(リジャッジ後のコンパイルエラーは公開されます)
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
ただし、clay言語の場合は開発者のデバッグのため、公開されます。
コンパイルメッセージ
main.c:9:1: error: return type defaults to 'int' [-Wimplicit-int]
9 | main(){
| ^~~~
main.c: In function 'main':
main.c:10:17: error: too many arguments to function 'mmap'; expected 0, have 6
10 | char*rp=mmap(0l,1l<<28,1,2,0,0ll);
| ^~~~ ~~
main.c:4:6: note: declared here
4 | char*mmap();
| ^~~~
main.c:21:25: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
21 | puts("-1");
| ^~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'puts'
+++ |+#include <stdio.h>
1 | #pragma GCC optimize("Ofast")
main.c:22:25: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
22 | exit(0);
| ^~~~
main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
+++ |+#include <stdlib.h>
1 | #pragma GCC optimize("Ofast")
main.c:22:25: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
22 | exit(0);
| ^~~~
main.c:22:25: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:33:17: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
33 | exit(0); // RE
| ^~~~
main.c:33:17: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c:35:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
35 | printf("%ld",d[l]);
| ^~~~~~
main.c:35:9: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:35:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:35:9: note: include '<stdio.h>' or provide a declaration of 'printf'
ソースコード
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
char*mmap();
#define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;}
long d[5000000];
main(){
char*rp=mmap(0l,1l<<28,1,2,0,0ll);
while(*rp++>=48);
RD(f);
RD(l);
int b=f;
do{
RD(x);
RD(v);
RD(w);
if(x>b){
puts("-1");
exit(0);
}
int c=b+v<x+f?b+v:x+f;
for(int i=c;i>=x;--i){
int j=i-v>=x?i-v:x;
if(i>b|d[i]>d[j]+w) d[i]=d[j]+w;
}
b=c;
}while(*rp);
if(l>b){
puts("-1");
exit(0); // RE
}
printf("%ld",d[l]);
}
tails