c++
题解
Staple0
这个作者很懒,什么都没留下…
展开
-
007:Aggressive cows
输入样例5 312849输出样例3其实不难,普普通通二分查找。//但智障如我,数组开小了,还忘记注释重定向...AC代码#include <cmath>#include <cstdio>#include <cstring>#include <iostream>#include <algori...原创 2019-12-21 11:32:07 · 175 阅读 · 0 评论 -
006:简单的整数划分问题
输入样例5输出样例7这道题想明白还是很简单的,将整数划分问题等价于向n个盘子里装n个苹果。AC代码#include <cmath>#include <cstdio>#include <cstring>#include <iostream>using namespace std;int a[60][60...原创 2019-12-21 00:56:39 · 241 阅读 · 0 评论 -
005:Boolean Expressions
输入样例( V | V ) & F & ( F| V)!V | V & V & !F & (F | V ) & (!F | F | !V & V)(F&F|V|!V&!F&!(F|F&V))输出样例Expression 1: FExpression 2: VExpression 3:...原创 2019-12-20 20:10:58 · 524 阅读 · 0 评论 -
计蒜客 正方形
题见计蒜客 挺有意思的#include <iostream>#include <cstring>#include <algorithm>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or ...原创 2018-08-03 11:45:34 · 214 阅读 · 0 评论 -
004:2的幂次方表示
数据范围一个正整数n(n≤20000)。样例输入137样例输出2(2(2)+2+2(0))+2(2+2(0))+2(0)AC代码#include <cmath>#include <cstdio>#include <cstring>#include <iostream>using namespace std...原创 2019-12-20 17:43:28 · 183 阅读 · 0 评论 -
003:全排列
输入样例abc输出样例abcacbbacbcacabcbaAC代码#include <cmath>#include <cstdio>#include <cstring>#include <iostream>#include <algorithm>using namespace std...原创 2019-12-20 17:41:32 · 221 阅读 · 0 评论 -
002:拨钟问题
样例输入3 3 0 2 2 2 2 1 2 样例输出4 5 8 9 AC代码:#include <cmath>#include <cstdio>#include <cstring>#include <iostream>using namespace std;int main(){ int aa[9], f...原创 2019-12-20 11:05:40 · 137 阅读 · 0 评论 -
001:特殊密码锁
输入样例011000输出样例1AC代码:#include <cmath>#include <cstdio>#include <cstring>#include <iostream>using namespace std;inline int divers(int n){ if(n) return 0; r...原创 2019-12-19 17:21:18 · 268 阅读 · 0 评论