結果
問題 | No.431 死亡フラグ |
ユーザー |
![]() |
提出日時 | 2018-05-14 22:51:17 |
言語 | Go (1.23.4) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 523 bytes |
コンパイル時間 | 18,583 ms |
コンパイル使用メモリ | 222,032 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 11:51:23 |
合計ジャッジ時間 | 16,196 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 16 |
ソースコード
package main import ( "bufio" "fmt" "os" "strconv" ) var sc = bufio.NewScanner(os.Stdin) func nextInt() int { sc.Scan() i, err := strconv.Atoi(sc.Text()) if err != nil { panic(err) } return i } func main() { sc.Split(bufio.ScanWords) var x []int x = append(x, nextInt(), nextInt(), nextInt(), nextInt()) if x[3] == 1 { fmt.Println("SURVIVED") } else { count := 0 for i := 0; i < 3; i++ { count += x[i] } if count >= 2 { fmt.Println("DEAD") } else { fmt.Println("SURVIVED") } } }