結果
| 問題 |
No.806 木を道に
|
| コンテスト | |
| ユーザー |
しめはじめ
|
| 提出日時 | 2019-05-29 09:43:53 |
| 言語 | PHP (843.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 417 bytes |
| コンパイル時間 | 2,457 ms |
| コンパイル使用メモリ | 32,016 KB |
| 実行使用メモリ | 34,872 KB |
| 最終ジャッジ日時 | 2024-09-17 15:58:08 |
| 合計ジャッジ時間 | 2,710 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 WA * 22 |
コンパイルメッセージ
No syntax errors detected in Main.php
ソースコード
<?php
$n = trim(fgets(STDIN));
$node = array();
for( $i = 1; $i <= $n; $i++ ){
$node[$i] = 0;
}
$ans = 0;
for( $i = 0; $i < ( $n - 1 ); $i++ ){
list( $a, $b ) = sscanf( trim(fgets(STDIN)), "%d %d" );
if ( ++$node[$a] > 2 ){
$ans += $node[$a] - 2;
}
if ( ++$node[$b] > 2 ){
$ans += $node[$b] - 2;
}
}
print $ans."\n";
しめはじめ