传送门
弄两个栈,一个存数,一个存运算符,然后乱搞。
代码
#include <cstdio> #include <cstring> #include <iostream> #define N 1000001 int n, top_d, top_f; int stack_d[N]; char s[N], stack_f[N]; bool b[N]; int main() stack_d[++top_d] = x; stack_f[++top_f] = s[i]; i++; while(i <= n) stack_d[++top_d] = x; if(stack_f[top_f] == '*') stack_f[++top_f] = s[i]; i++; } for(i = 1; i <= top_d; i++) stack_d[i] = (stack_d[i] + stack_d[i 1]) % 10000; printf("%d\n", stack_d[top_d]); return 0; }
上一篇:[luoguP1156] 垃圾陷阱(DP)
下一篇:[luoguP1373] 小a和uim之大逃离(DP)
模拟









