[luoguP1005] 矩阵取数游戏(DP + 高精度)
传送门
和奶牛那个题很像,每一行状态互不影响,也就是求 n 遍DP
不过高精度非常恶心,第一次写,调了我一上午。
——代码
1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 5 struct Big_int 6 13 }; 14 15 int n, m; 16 Big_int ans, a[81], f[81][81]; 17 18 inline void clear(Big_int &x) 19 23 24 inline Big_int Big(int x) 25 33 return ret; 34 } 35 36 inline bool operator > (const Big_int x, const Big_int y) 37 45 46 inline Big_int Max(const Big_int x, const Big_int y) 47 50 51 inline int max(int x, int y) 52 55 56 inline Big_int operator + (const Big_int x, const Big_int y) 57 67 while(!ret.s[ret.idx 1] && ret.idx > 1) ret.idx; 68 return ret; 69 } 70 71 inline Big_int operator * (const Big_int x, const Big_int y) 72 83 while(!ret.s[ret.idx 1] && ret.idx > 1) ret.idx; 84 return ret; 85 } 86 87 inline void print(const Big_int x) 88 94 95 inline int read() 96 103 104 inline Big_int dp(int x, int y, Big_int z) 105 110 111 int main() 112 124 print(ans); 125 return 0; 126 }View Code
上一篇:[luoguP2875] [USACO07FEB]牛的词汇The Cow Lexicon(DP)
下一篇:[luoguP3252] [JLOI2012]树(DP)
DP 高精度
pla文件怎么看,pla文件用什么打开?
pl1文件怎么看,pl1文件用什么打开?
pl文件怎么看,pl文件用什么打开?
pl0文件怎么看,pl0文件用什么打开?
pkt文件怎么看,pkt文件用什么打开?
pkm文件怎么看,pkm文件用什么打开?
pks文件怎么看,pks文件用什么打开?
pka文件怎么看,pka文件用什么打开?
pkh文件怎么看,pkh文件用什么打开?
pkg文件怎么看,pkg文件用什么打开?