結果
問題 |
No.250 atetubouのzetubou
|
ユーザー |
![]() |
提出日時 | 2015-07-29 16:57:47 |
言語 | Go1.4 (1.4.2) |
結果 |
AC
|
実行時間 | 106 ms / 5,000 ms |
コード長 | 858 bytes |
コンパイル時間 | 417 ms |
コンパイル使用メモリ | 33,980 KB |
実行使用メモリ | 71,948 KB |
最終ジャッジ日時 | 2024-11-25 00:35:01 |
合計ジャッジ時間 | 3,325 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 20 |
ソースコード
package main import ( "bufio" "fmt" "os" "strconv" ) func main() { solve() } func solve() { pascal() Q := nextInt() var d, x, t int for i := 0; i < Q; i++ { d = nextInt() x = nextInt() t = nextInt() if p[d+x-1][x] <= t { fmt.Println("AC") } else { fmt.Println("ZETUBOU") } } } const S = 1000000000000000 const MAX = 3000 var p [MAX][MAX]int func pascal() { p[0][0] = 1 for i := 1; i < MAX; i++ { for j := 0; j < MAX; j++ { if j == 0 { p[i][j] = p[i-1][j] } else { if p[i-1][j-1]+p[i-1][j] < 0 { p[i][j] = p[i-1][j] } else { p[i][j] = p[i-1][j-1] + p[i-1][j] } } } } return } var s = bufio.NewScanner(os.Stdin) func next() string { s.Split(bufio.ScanWords) s.Scan() return s.Text() } func nextInt() int { i, e := strconv.Atoi(next()) if e != nil { panic(e) } return i }