結果
問題 | No.468 役に立つ競技プログラミング実践編 |
ユーザー | tails |
提出日時 | 2016-12-18 02:10:10 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 476 bytes |
コンパイル時間 | 422 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 17,776 KB |
最終ジャッジ日時 | 2024-06-06 03:58:59 |
合計ジャッジ時間 | 4,014 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 3 ms
11,884 KB |
testcase_01 | AC | 2 ms
9,836 KB |
testcase_02 | AC | 3 ms
11,888 KB |
testcase_03 | AC | 2 ms
9,712 KB |
testcase_04 | AC | 2 ms
11,764 KB |
testcase_05 | AC | 2 ms
9,840 KB |
testcase_06 | AC | 2 ms
11,884 KB |
testcase_07 | AC | 2 ms
11,888 KB |
testcase_08 | AC | 2 ms
11,884 KB |
testcase_09 | AC | 3 ms
11,760 KB |
testcase_10 | AC | 2 ms
9,836 KB |
testcase_11 | AC | 2 ms
11,764 KB |
testcase_12 | AC | 2 ms
11,760 KB |
testcase_13 | AC | 3 ms
11,764 KB |
testcase_14 | AC | 3 ms
11,888 KB |
testcase_15 | AC | 2 ms
11,760 KB |
testcase_16 | AC | 3 ms
11,888 KB |
testcase_17 | AC | 3 ms
9,836 KB |
testcase_18 | AC | 3 ms
11,760 KB |
testcase_19 | AC | 2 ms
9,716 KB |
testcase_20 | AC | 3 ms
11,884 KB |
testcase_21 | AC | 3 ms
11,888 KB |
testcase_22 | AC | 2 ms
9,720 KB |
testcase_23 | AC | 2 ms
9,844 KB |
testcase_24 | AC | 86 ms
13,684 KB |
testcase_25 | AC | 87 ms
13,552 KB |
testcase_26 | AC | 88 ms
13,552 KB |
testcase_27 | AC | 87 ms
13,420 KB |
testcase_28 | AC | 86 ms
14,704 KB |
testcase_29 | AC | 85 ms
13,420 KB |
testcase_30 | AC | 86 ms
14,572 KB |
testcase_31 | AC | 85 ms
13,548 KB |
testcase_32 | AC | 90 ms
13,676 KB |
testcase_33 | AC | 87 ms
14,832 KB |
testcase_34 | AC | 33 ms
17,776 KB |
testcase_35 | AC | 3 ms
11,756 KB |
testcase_36 | AC | 2 ms
9,844 KB |
コンパイルメッセージ
main.c:1:9: warning: type defaults to ‘int’ in declaration of ‘A’ [-Wimplicit-int] 1 | typedef A[500010]; | ^ main.c:4:1: warning: data definition has no type or storage class 4 | n,y; | ^ main.c:4:1: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] main.c:4:3: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int] 4 | n,y; | ^ main.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 6 | f(a,i){ | ^ main.c: In function ‘f’: main.c:6:1: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int] main.c:6:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:17:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 17 | g(b,i){ | ^ main.c: In function ‘g’: main.c:17:1: warning: type of ‘b’ defaults to ‘int’ [-Wimplicit-int] main.c:17:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:28:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 28 | main(i){ | ^~~~ main.c: In function ‘main’: main.c:28:1: warning: type of ‘i’ defaults to ‘int’ [-Wimplicit-int] main.c:29:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 29 | scanf("%d%*d",&n); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | typedef A[500010]; main.c:29:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 29 | scanf("%d%*d",&n); | ^~~~~ main.c:29:9: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ main.c:37:12: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration] 37 | n=!printf("%d %d/%d",t[n-1],n-y,n); | ^~~~~~ main.c:37:12:
ソースコード
typedef A[500010]; A a,b,c,la,lb,li; A sa,sb,d={1},t; n,y; f(a,i){ if(t[a]<i){ t[a]=i; } if(!--d[a]){ for(i=sa[a];i;i=la[i]){ f(b[i],t[a]+c[i]); } } } g(b,i){ if(!d[b]++){ ++y; for(i=sb[b];i;i=lb[i]){ if(t[a[i]]==t[b]-c[i]){ g(a[i]); } } } } main(i){ scanf("%d%*d",&n); for(;~scanf("%d%d%d",a+i,b+i,c+i);++i){ la[i]=sa[a[i]];sa[a[i]]=i; lb[i]=sb[b[i]];sb[b[i]]=i; ++d[b[i]]; } f(0,0); g(n-1); n=!printf("%d %d/%d",t[n-1],n-y,n); }