摘要:
老生常谈的问题,留商取余; #include<iostream> #include<string> using namespace std; int n; string charge(int n) { string s=""; while (n != 0) { int r = n % 8; s = 阅读全文
摘要:
没啥难度,还是难以判断测试用例的问题,也就是k是否大于10,否则就会采用字符串进行判断; #include<iostream> #include<vector> #include<queue> #include<string> using namespace std; int n, k; struc 阅读全文
摘要:
水题; #include<iostream> #include<vector> using namespace std; const int maxn = 100; int m, n, p; int m1[maxn][maxn], m2[maxn][maxn],m3[maxn][maxn]; int 阅读全文
摘要:
统计每个字符子串得重复字符个数,直接利用数学问题输出坐标就可以; #include<iostream> #include<string> #include<vector> using namespace std; string s; int n; struct point { int index = 阅读全文
摘要:
对一个非方阵矩阵转置; 注意转置后列变成行,行变成列; #include<iostream> #include<stdlib.h> using namespace std; const int maxn = 500; int a[maxn][maxn]; int m, n; int main() { 阅读全文
摘要:
问题:座位排序,对于7个人A,B,、、、G,输入7行,每一行比如 A B 6,G C -2这种表示A在B前面6排,G在C前面-2排(在C后面2排),求出这7个人从前到后顺序,最前面的是第一排,输出结果 目前没看出这个要用什么数据结构在做,个人觉得直接设定一个基准坐标,循环计算各个点的数轴位置即可; 阅读全文