#40695: TLE解決法(C)


seancai78@gmail.com (風月春秋)

學校 : 臺北市立成功高級中學
編號 : 176406
來源 : [140.113.124.212]
最後登入時間 :
2024-09-05 15:41:31
a249. 00679 - Dropping Balls -- UVa679 | From: [118.166.15.124] | 發表日期 : 2024-06-06 16:26

可以用bitset 
0往左 / 1往右

往右時的數字 = 上*2+1
往左時的數字 = 上*2

合併=> serial = serial * 2 + i[ 層數 - 1 ]

超快0.5s

*** 注意不要使用pow超慢 ***

 
ZeroJudge Forum