上一页 1 2 3 4 5 6 7 ··· 49 下一页
摘要: "Sine之舞" cpp include include include using namespace std; int main(){ int n; cin n; vector A(n+1,""); for(int i=1; i0; j ){ str="sin("+str+")"; if(j 1 阅读全文
posted @ 2019-02-03 20:44 A-Little-Nut 阅读(316) 评论(0) 推荐(0) 编辑
摘要: "FJ的字符串" cpp include include using namespace std; int main(){ string str=""; int N; cin N; for(int i=0; i 阅读全文
posted @ 2019-02-03 20:42 A-Little-Nut 阅读(197) 评论(0) 推荐(0) 编辑
摘要: "芯片测试" cpp / 根据题意可知,如果是坏芯片则对应的列中除了对角线位置处所有的0的个数一定大于1的个数,又非好即坏 / include include using namespace std; int main(){ int n, flag=0; cin n; vector vi(n+1, 阅读全文
posted @ 2019-02-02 21:57 A-Little-Nut 阅读(243) 评论(0) 推荐(0) 编辑
摘要: "龟兔赛跑预测" cpp / 根据题目这里的时间一定是整数,且题目说了l一定是v1和v2的整数倍 / include using namespace std; int main(){ int v1, v2, t, s, l, s1=0, s2=0, sec=0, t1, t2, tag1=0, ta 阅读全文
posted @ 2019-02-02 21:35 A-Little-Nut 阅读(355) 评论(0) 推荐(0) 编辑
摘要: "回形取数" / 逆时针读数,但每读过一个就标志已读 / include include using namespace std; int main(){ int m, n, cnt=1, x=0, y=0, flag=0; cin m n; vector M(m, vector(n, 0)), v 阅读全文
posted @ 2019-02-02 17:19 A-Little-Nut 阅读(147) 评论(0) 推荐(0) 编辑
摘要: "2n皇后问题" cpp include include using namespace std; int cnt = 0, n; vector vi(9, vector(9,0) ); //储存棋盘 vector row1(9, 0), row2(9, 0), md1(19, 0), md2(19 阅读全文
posted @ 2019-01-31 13:20 A-Little-Nut 阅读(174) 评论(0) 推荐(0) 编辑
摘要: "Huffuman树" cpp / 解法一 / include include using namespace std; int main(){ priority_queue, greater q; int n, t, sum = 0; cin n; for( int i=0; i t; q.pus 阅读全文
posted @ 2019-01-29 20:41 A-Little-Nut 阅读(106) 评论(0) 推荐(0) 编辑
摘要: set的一些用法 set的特性 set的特性是,所有元素都会根据元素的键值自动排序,set不允许两个元素有相同的键值。 set的一些常用操作函数 + insert() insert(key_value); 将key_value插入到set中 ,返回值是pair::iterator,bool ,boo 阅读全文
posted @ 2019-01-29 20:17 A-Little-Nut 阅读(380) 评论(0) 推荐(0) 编辑
摘要: 参考 "GGBeng" 相关定义 优先队列容器与队列一样,只能从队尾插入元素,从队首删除元素。但是它有一个特性,就是队列中最大的元素总是位于队首,所以出队时,并非按照先进先出的原则进行,而是将当前队列中最大的元素出队。这点类似于给队列里的元素进行了由大到小的顺序排序。元素的比较规则默认按元素值由大到 阅读全文
posted @ 2019-01-29 19:41 A-Little-Nut 阅读(375) 评论(0) 推荐(0) 编辑
摘要: "高精度加法" cpp include include using namespace std; int main(){ vector vi(10005, 0); vi[0]=1; int r=0, n, flag=0; cin n; for(int i=1; i=0; i ){ if(vi[i]! 阅读全文
posted @ 2019-01-28 12:34 A-Little-Nut 阅读(206) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 49 下一页