本子君

2019年3月8日

UVa540

摘要: 代码基本直接搬的紫书,初次接触了map和queue,简单写一下map和queue的使用笔记 queue的头文件是<queue> 基本操作有: back()返回最后一个元素 empty()队列为空返回真 front()返回第一个元素 pop()删除第一个元素 push()在末尾加入一个元素 size( 阅读全文

posted @ 2019-03-08 23:34 本子君 阅读(245) 评论(0) 推荐(0) 编辑

2019年3月5日

HDU2035

摘要: 快速幂+模运算 阅读全文

posted @ 2019-03-05 23:23 本子君 阅读(182) 评论(0) 推荐(0) 编辑

HDU2034

摘要: set容器初使用 阅读全文

posted @ 2019-03-05 23:16 本子君 阅读(133) 评论(0) 推荐(0) 编辑

2019年2月28日

深度优先搜索 全排列

摘要: #include using namespace std; int a[10],book[10],n;//全局变量未赋值为0 void dfs(int step) { if(step==n+1) { for(int i=1;i>n; dfs(1); return 0; } 阅读全文

posted @ 2019-02-28 22:43 本子君 阅读(268) 评论(0) 推荐(0) 编辑

2019年2月20日

2016蓝桥杯省赛 凑算式

摘要: 看别人都用的next_permutation,蒟蒻看不懂,想着用暴力写写就能出来,结果不对,最后在除法前都加了一个double,结果对了,但是加了和没加之前的四舍五入的结果也差的太远了吧...... 阅读全文

posted @ 2019-02-20 22:31 本子君 阅读(330) 评论(0) 推荐(0) 编辑

2019年2月16日

HDU2028

摘要: 编译的时候卡在error: 'cin' was not declared in this scope 以为头文件打错了,顺手改成#include<cstdio>,还是不对,索性又改回来了,然后编译成功...... int gcd(int a, int b){ return a%b==0 ? b:gc 阅读全文

posted @ 2019-02-16 00:34 本子君 阅读(406) 评论(0) 推荐(0) 编辑

导航