結果
問題 | No.468 役に立つ競技プログラミング実践編 |
ユーザー | tails |
提出日時 | 2016-12-18 01:40:44 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 118 ms / 2,000 ms |
コード長 | 534 bytes |
コンパイル時間 | 200 ms |
コンパイル使用メモリ | 20,608 KB |
実行使用メモリ | 11,648 KB |
最終ジャッジ日時 | 2024-05-08 06:06:44 |
合計ジャッジ時間 | 3,072 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | AC | 1 ms
5,248 KB |
testcase_02 | AC | 0 ms
5,248 KB |
testcase_03 | AC | 1 ms
5,376 KB |
testcase_04 | AC | 1 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | AC | 1 ms
5,376 KB |
testcase_11 | AC | 1 ms
5,376 KB |
testcase_12 | AC | 1 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 2 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | AC | 2 ms
5,376 KB |
testcase_20 | AC | 2 ms
5,376 KB |
testcase_21 | AC | 1 ms
5,376 KB |
testcase_22 | AC | 1 ms
5,376 KB |
testcase_23 | AC | 2 ms
5,376 KB |
testcase_24 | AC | 118 ms
11,520 KB |
testcase_25 | AC | 116 ms
11,648 KB |
testcase_26 | AC | 118 ms
11,520 KB |
testcase_27 | AC | 114 ms
11,520 KB |
testcase_28 | AC | 115 ms
11,648 KB |
testcase_29 | AC | 114 ms
11,648 KB |
testcase_30 | AC | 116 ms
11,520 KB |
testcase_31 | AC | 116 ms
11,520 KB |
testcase_32 | AC | 118 ms
11,648 KB |
testcase_33 | AC | 116 ms
11,520 KB |
testcase_34 | AC | 38 ms
11,648 KB |
testcase_35 | AC | 1 ms
5,376 KB |
testcase_36 | AC | 1 ms
5,376 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 | i,n,m,y; | ^ main.c:4:1: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] main.c:4:3: warning: type defaults to ‘int’ in declaration of ‘n’ [-Wimplicit-int] 4 | i,n,m,y; | ^ main.c:4:5: warning: type defaults to ‘int’ in declaration of ‘m’ [-Wimplicit-int] 4 | i,n,m,y; | ^ main.c:4:7: warning: type defaults to ‘int’ in declaration of ‘y’ [-Wimplicit-int] 4 | i,n,m,y; | ^ main.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 6 | f(a,j){ | ^ 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 ‘j’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:18:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 18 | g(b,j){ | ^ main.c: In function ‘g’: main.c:18:1: warning: type of ‘b’ defaults to ‘int’ [-Wimplicit-int] main.c:18:1: warning: type of ‘j’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:30:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 30 | main(e){ | ^~~~ main.c: In function ‘main’: main.c:30:1: warning: type of ‘e’ defaults to ‘int’ [-Wimplicit-int] main.c:31:9: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration] 31 | scanf("%d%d",&n,&m); | ^~~~~ main.c:1:1: note: include ‘<stdio.h>’ or provide a declaration of ‘scanf’ +++ |+#include <stdio.h> 1 | typedef A[500010]; main.c:31:9: warning: incompatible implicit declaration of built-in function ‘scanf’ [-Wbuiltin-declaration-mismatch] 31 | scanf("%d%d",&n,&m); | ^~~~~ main.c:31:9: note: i
ソースコード
typedef A[500010]; A a,b,c,la,lb,li; A sa,sb,d={1},t; i,n,m,y; f(a,j){ if(t[a]<j){ t[a]=j; } if(!--d[a]){ for(j=sa[a];j;j=la[j]){ i=li[j]; f(b[i],t[a]+c[i]); } } } g(b,j){ if(!d[b]++){ ++y; for(j=sb[b];j;j=lb[j]){ i=li[j]; if(t[a[i]]==t[b]-c[i]){ g(a[i]); } } } } main(e){ scanf("%d%d",&n,&m); for(i=0;i<m;++i){ scanf("%d%d%d",a+i,b+i,c+i); la[e]=sa[a[i]];sa[a[i]]=e; lb[e]=sb[b[i]];sb[b[i]]=e; li[e]=i; ++e; ++d[b[i]]; } f(0,0); g(n-1); n=!printf("%d %d/%d",t[n-1],n-y,n); }