2019年1月23日

完全背包记录路径poj1787 好题

摘要: 这题有点多重背包的感觉,但还是用完全背包解决,dp[j]表示凑到j元钱时的最大硬币数,pre[j]是前驱,used[j]是凑到j时第i种硬币的用量 △回溯答案时i-pre[i]就是硬币价值 阅读全文

posted @ 2019-01-23 15:04 zsben 阅读(183) 评论(0) 推荐(0)

cf1104d二分+数学

摘要: #include using namespace std; bool ask(int x,int y){ printf("? %d %d\n",x,y); fflush(stdout); char buf[4]; scanf("%s",buf); return buf[0]=='x'; } int work(){ if(ask(0,1))ret... 阅读全文

posted @ 2019-01-23 12:43 zsben 阅读(199) 评论(0) 推荐(0)

导航