每日一题
牛客、力扣经典题目
李憨憨_
这个作者很懒,什么都没留下…
展开
-
2021-08-19
练习一CM26 二进制插入题目描述:class BinInsert {public: int binInsert(int n, int m, int j, int i) { // write code here m = m << j; return n | m; }};练习二HJ60查找组成一个偶数最接近的两个素数题目描述:#include <iostream>#include <algo原创 2021-08-19 11:13:00 · 120 阅读 · 4 评论 -
2021-08-18
练习一HJ91走方格的方案数题目描述:#include <iostream>using namespace std;int pathWay(int n, int m){ if(n == 0 || m == 0) return 1; return pathWay(n - 1, m) + pathWay(n, m - 1);}int main(){ int n, m; while(cin >> n >>原创 2021-08-18 16:21:19 · 125 阅读 · 6 评论 -
2021-08-17
练习一JZ49把字符串转换成整数题目描述:class Solution {public: int StrToInt(string str) { if(str.empty()) return 0; int flag = 1; int sum = 0; if(str[0] == '-') { flag = -1; str[0] = '0';原创 2021-08-17 16:46:25 · 99 阅读 · 0 评论 -
2021-08-16
练习一WY18统计回文题目描述:#include <iostream>#include <string>using namespace std;bool IsCircle(const string& s){ int begin = 0; int end = s.size() - 1; while(begin < end) { if(s[begin] != s[end]) retu原创 2021-08-16 19:04:24 · 125 阅读 · 6 评论 -
2021-08-14
练习一OR62:倒置字符串题目描述:#include <iostream>#include <string>#include <algorithm>using namespace std;int main(){ string str; while(getline(cin, str)) { reverse(str.begin(), str.end()); auto start = str.begi原创 2021-08-14 16:57:25 · 111 阅读 · 2 评论 -
2021-08-12
练习一组队竞赛:题目描述#include <iostream>#include <vector>#include <algorithm>using namespace std;int main(){ int n; while(cin >> n) { vector<int> a; a.resize(3 * n); for(int i = 0; i <原创 2021-08-12 17:14:02 · 108 阅读 · 4 评论