wydxry
wydxry
全部文章
分类
题解(86)
归档
标签
去牛客网
登录
/
注册
wydxry的博客
全部文章
(共91篇)
题解 | #最长公共子序列(一)#
#include <bits/stdc++.h> using namespace std; const int N=1e3+5; int dp[N][N]={0}; int n,m; string a,b; int main() { cin>>n>>m; ...
C++
动态规划
2022-03-03
1
420
题解 | #二分查找-II#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 如果目标值存在返回下标,否则返回 -1 * @param nums int整型vector * ...
C++
2021-12-03
0
437
题解 | #筛选法求素数#
#include <bits/stdc++.h> using namespace std; int main() { int n; int prime[105]={0}; prime[0]=1; prime[1]=1; for(int i=2;i&...
C++
2021-12-03
1
419
题解 | #棋子翻转#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param A int整型vector<vector<>> * ...
C++
2021-12-02
0
646
题解 | #最大差值#
前缀和 class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param A int整型vector * @param n int整型 ...
C++
2021-12-02
0
452
题解 | #记负均正#
#include <bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n){ int d; int cnt1=0,cnt2=0; ...
C++
2021-11-12
5
1164
题解 | #输入整型数组和排序标识,对其元素按照升序或降序进行排序#
#include <bits/stdc++.h> using namespace std; int cmp(int a,int b) { return a>=b; } int main() { int a[1005]; int n; int d; ...
C++
2021-11-12
1
431
题解 | #计算某字母出现次数#
#include <bits/stdc++.h> using namespace std; int main() { char c; string str; getline(cin, str); scanf("%c",&c); if(c>=...
C++
2021-11-12
0
369
题解 | #有效括号序列#
class Solution { public: /** * * @param s string字符串 * @return bool布尔型 */ bool isValid(string s) { // write code ...
C++
2021-11-12
1
378
题解 | #编写函数实现两数交换(引用方式)#
#include <iostream> using namespace std; // write your code here...... void swap(int &m,int &n){ int t=m; m=n; n=t; } int ...
C++
2021-11-09
0
494
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页