結果

問題 No.250 atetubouのzetubou
ユーザー fmhrfmhr
提出日時 2015-07-29 12:09:50
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 651 bytes
コンパイル時間 10,514 ms
コンパイル使用メモリ 222,532 KB
実行使用メモリ 73,744 KB
最終ジャッジ日時 2024-04-19 03:07:10
合計ジャッジ時間 15,595 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 205 ms
72,576 KB
testcase_16 AC 211 ms
72,576 KB
testcase_17 AC 213 ms
72,576 KB
testcase_18 AC 209 ms
72,576 KB
testcase_19 AC 214 ms
72,576 KB
testcase_20 AC 33 ms
71,936 KB
testcase_21 AC 33 ms
71,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
)

func main() {
	solve()
}

func solve(){
	pascal()
	var Q int
	fmt.Scan(&Q)
	var d, x, t uint64
	for i:=0; i<Q; i++ {
	    fmt.Scan(&d, &x, &t)
		//fmt.Println(p[d+x-1][x])
		if p[d+x-1][x]<=t{
			fmt.Println("AC")
		}else{
			fmt.Println("ZETUBOU")
		}
	}
}

const MAX = 3000
var p [MAX][MAX]uint64
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]>2000000000000000 || p[i-1][j-1]>2000000000000000{
					p[i][j] = p[i-1][j]
				}else{
					p[i][j] = (p[i-1][j-1]+p[i-1][j])
				}
			}
			//fmt.Println(p[i][j])
		}
	}
	return
}
0