結果
問題 | No.330 Eigenvalue Decomposition |
ユーザー | rickytheta |
提出日時 | 2015-12-23 12:58:58 |
言語 | C90 (gcc 11.4.0) |
結果 |
AC
|
実行時間 | 63 ms / 5,000 ms |
コード長 | 268 bytes |
コンパイル時間 | 259 ms |
コンパイル使用メモリ | 21,504 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-06 03:34:48 |
合計ジャッジ時間 | 2,799 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 25 ms
5,248 KB |
testcase_01 | AC | 0 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 26 ms
5,376 KB |
testcase_04 | AC | 0 ms
5,376 KB |
testcase_05 | AC | 1 ms
5,376 KB |
testcase_06 | AC | 26 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 19 ms
5,376 KB |
testcase_09 | AC | 54 ms
5,376 KB |
testcase_10 | AC | 0 ms
5,376 KB |
testcase_11 | AC | 15 ms
5,376 KB |
testcase_12 | AC | 54 ms
5,376 KB |
testcase_13 | AC | 1 ms
5,376 KB |
testcase_14 | AC | 15 ms
5,376 KB |
testcase_15 | AC | 2 ms
5,376 KB |
testcase_16 | AC | 0 ms
5,376 KB |
testcase_17 | AC | 2 ms
5,376 KB |
testcase_18 | AC | 10 ms
5,376 KB |
testcase_19 | AC | 1 ms
5,376 KB |
testcase_20 | AC | 2 ms
5,376 KB |
testcase_21 | AC | 63 ms
5,376 KB |
testcase_22 | AC | 1 ms
5,376 KB |
testcase_23 | AC | 4 ms
5,376 KB |
testcase_24 | AC | 50 ms
5,376 KB |
testcase_25 | AC | 1 ms
5,376 KB |
testcase_26 | AC | 2 ms
5,376 KB |
testcase_27 | AC | 1 ms
5,376 KB |
testcase_28 | AC | 0 ms
5,376 KB |
testcase_29 | AC | 1 ms
5,376 KB |
testcase_30 | AC | 1 ms
5,376 KB |
testcase_31 | AC | 1 ms
5,376 KB |
testcase_32 | AC | 1 ms
5,376 KB |
testcase_33 | AC | 0 ms
5,376 KB |
testcase_34 | AC | 1 ms
5,376 KB |
testcase_35 | AC | 1 ms
5,376 KB |
コンパイルメッセージ
main.c:2:1: warning: data definition has no type or storage class 2 | d[100010],i; | ^ main.c:2:1: warning: type defaults to ‘int’ in declaration of ‘d’ [-Wimplicit-int] main.c:2:11: warning: type defaults to ‘int’ in declaration of ‘i’ [-Wimplicit-int] 2 | d[100010],i; | ^ main.c:3:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 3 | r(x){ | ^ main.c: In function ‘r’: main.c:3:1: warning: type of ‘x’ defaults to ‘int’ [-Wimplicit-int] main.c: At top level: main.c:6:1: warning: return type defaults to ‘int’ [-Wimplicit-int] 6 | main(n,m,a,b,c){ | ^~~~ main.c: In function ‘main’: main.c:6:1: warning: type of ‘n’ defaults to ‘int’ [-Wimplicit-int] main.c:6:1: warning: type of ‘m’ defaults to ‘int’ [-Wimplicit-int] main.c:6:1: warning: type of ‘a’ defaults to ‘int’ [-Wimplicit-int] main.c:6:1: warning: type of ‘b’ defaults to ‘int’ [-Wimplicit-int] main.c:6:1: warning: type of ‘c’ defaults to ‘int’ [-Wimplicit-int] main.c:7:3: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d%d",&n,&m); | ^~~~~~~~~~~~~~~~~~~ main.c:10:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 10 | scanf("%d%d%d",&a,&b,&c); | ^~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> d[100010],i; r(x){ return d[x]<0?x:(d[x]=r(d[x])); } main(n,m,a,b,c){ scanf("%d%d",&n,&m); for(i=n;i--;)d[i]=-1; for(;m--;){ scanf("%d%d%d",&a,&b,&c); a=r(a-1);b=r(b-1); if(a-b)d[a]+=d[b],d[b]=a,--n; } i=!printf("%d\n",n); }