ICTO-Yeah
ICTO-Yeah
全部文章
分类
题解(6)
归档
标签
去牛客网
登录
/
注册
ICTO-Yeah的博客
全部文章
(共6篇)
题解 | #购物单#
本解题提供一个树遍历的方法,同时考虑附件与主件的约束,考虑预算约束 其中样本: 5个物品,结果空间32,搜索了13个树分支路径 round 13 finished<-------- 50 5 20 3 5 20 3 5 10 3 0 10 2 0 10 1 0 样本: 30个物品,1G...
C++
2022-03-10
0
224
使用整数的二进制遍历一个组合问题
假设一组输入1500 7500 1 0400 4 0300 5 1400 5 1200 5 0500 4 0400 4 0 转化显示为500 400 300 400 200 500 400那么如果选择是1不选择是0,那么一个选择就是一个01串而这个串可以用一个整数的二进制来表达从0000...
2020-03-30
2
1351
C,Sprintf解法,使用字符串直观处理
#include<stdio.h> #include<string.h> int main(){ int iput=0,oput=0,len=0,i=0,j=0; char iLiteral[32]=""; char oLiteral[32]=""; ...
2020-03-28
0
564
C实现
使用字符串拼接,使用输入流预判和返回 #include<stdio.h> #include<string.h> int main(){ char input[9];//用于接收输入 char zPadding[9]="";//用于构建'0'填充串 ch...
输入流回填
C
2020-03-26
23
2979
C语言极简,4条语句
#include <stdio.h> #include <string.h> #include <ctype.h> int main(void){ char str[1000]="\0"; char inputChar='\0'; char...
2020-03-19
27
3520
C:一遍循环
采用指针,在遍历同时消除重复,不单独安排冗余消除循环 #include <stdio.h> #include <stdlib.h> int sortArr(int total,int* arr){ int* p=NULL; p=arr; for(int...
2020-03-18
13
1171