updata:
2018-5-12
免费馅饼
1 #include2 #define cl(a,b) memset(a,b,sizeof(a)) 3 #define debug(a) cerr<<#a<<"=="< < pii; 7 8 const int maxn=1e4+10; 9 10 int mp[maxn][maxn];11 int dp[maxn][maxn][2];12 13 int main()14 {15 int n,m;16 scanf("%d%d",&n,&m);17 for(int i=0;i
----------------------------------------------------------------
有几个题没有留
答完才发现是按最高分算 不是最后提交的
早知道就不存备份了
A.显然没有找到正解 直接set走一波到80%了
lower_bound竟然才30% 玄学啊...
1 #include2 #define cl(a,b) memset(a,b,sizeof(a)) 3 #define debug(a) cerr<<#a<<"=="< < pii; 7 8 const int maxn=1e6+1000; 9 10 set st;11 12 int main()13 {14 int n,k,x;15 scanf("%d%d",&n,&k);16 for(int i=0;i
B.是一个关于字符串处理的题 反正是有两种操作 问最快处理到当前串的步数
算了下复杂度感觉bfs走一波应该没问题 最后70分也懒得优化了
//也是暴力走一波到70 代码没留
C.中缀转后缀这种东西我怎么会自己写
1 #coding=utf-8 2 3 import sys 4 5 6 def show(num): 7 line1 = "" 8 line2 = "" 9 line3 = ""10 line4 = ""11 line5 = ""12 st = str(num)13 first = 114 for i in st :15 if first != 1:16 line1 += '..'17 line2 += '..'18 line3 += '..'19 line4 += '..'20 line5 += '..'21 first = 022 if i == '0' :23 line1 += '66666'24 line2 += '6...6'25 line3 += '6...6'26 line4 += '6...6'27 line5 += '66666'28 if i == '1' :29 line1 += '....6'30 line2 += '....6'31 line3 += '....6'32 line4 += '....6'33 line5 += '....6'34 if i == '2' :35 line1 += '66666'36 line2 += '....6'37 line3 += '66666'38 line4 += '6....'39 line5 += '66666'40 if i == '3' :41 line1 += '66666'42 line2 += '....6'43 line3 += '66666'44 line4 += '....6'45 line5 += '66666'46 if i == '4' :47 line1 += '6...6'48 line2 += '6...6'49 line3 += '66666'50 line4 += '....6'51 line5 += '....6'52 if i == '5' :53 line1 += '66666'54 line2 += '6....'55 line3 += '66666'56 line4 += '....6'57 line5 += '66666'58 if i == '6' :59 line1 += '66666'60 line2 += '6....'61 line3 += '66666'62 line4 += '6...6'63 line5 += '66666'64 if i == '7' :65 line1 += '66666'66 line2 += '....6'67 line3 += '....6'68 line4 += '....6'69 line5 += '....6'70 if i == '8' :71 line1 += '66666'72 line2 += '6...6'73 line3 += '66666'74 line4 += '6...6'75 line5 += '66666'76 if i == '9' :77 line1 += '66666'78 line2 += '6...6'79 line3 += '66666'80 line4 += '....6'81 line5 += '66666'82 print line183 print line284 print line385 print line486 print line587 88 if __name__ == "__main__":89 n = int(sys.stdin.readline())90 for i in range(n):91 line = sys.stdin.readline()92 res = eval(line)93 # print(res)94 show(res)
D.暴力一波走了30分 其他的肝不动了= =
E.这个复杂度高的一批 数据太水了吧
(虽然加了一点玄学优化 可能就给优化掉了?
1 #include2 #define cl(a,b) memset(a,b,sizeof(a)) 3 #define debug(a) cerr<<#a<<"=="< < pii; 7 8 const int maxn=1e6+10; 9 10 int n,k,h,mx;11 bool high[maxn<<1];12 int dp[maxn<<1];13 14 void check()15 {16 dp[0]=0;17 for(int i=0;i<=mx;i++)18 {19 for(int j=i+1;j<=i+h;j++)20 {21 if(high[j]) dp[2*j-i]=min(dp[2*j-i],dp[i]+1);22 }23 }24 25 }26 27 int main()28 {29 int x,ans=-1;30 mx=-1;31 scanf("%d%d%d",&n,&k,&h);32 33 for(int i=0;i =0;i--)42 {43 if(dp[i]<=k)44 {45 ans=i;46 break;47 }48 }49 printf("%d\n",ans);50 return 0;51 }/*52 53 3 3 254 1 3 655 56 */