摘要:
按照题意模拟就行 1 class Solution: 2 def strongPasswordCheckerII(self, password: str) -> bool: 3 # T="!@#$%^&*()-+" 4 if len(password)<8: 5 # print(1) 6 retur 阅读全文
摘要:
1 class Solution { 2 public: 3 int countPairs(vector<int>& nums, int k) { 4 int s=0; 5 for(int i=0;i<nums.size();i++){ 6 for(int j=i+1;j<nums.size();j 阅读全文
摘要:
1 #define pb push_back 2 class Solution { 3 public: 4 int minimumSum(int num) { 5 vector<int> p; 6 while(num){ 7 p.pb(num%10),num/=10; 8 } 9 sort(p.be 阅读全文
摘要:
直接贪心就行 1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 #define int long long 6 7 const int N = 3e5+100 ,inf = 0x3f3f3f3f; 8 9 int n,arr[N],k; 阅读全文
摘要:
edgnb 1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 5 int main(){ 6 string s; 7 cin>>s; 8 int t=0; 9 for(int i=0;i<s.size();i++){ 阅读全文
摘要:
1 #include <bits/stdc++.h> 2 3 using namespace std; 4 5 #define int long long 6 #define pb push_back 7 8 const int N=2e6+5,inf=0x3f3f3f3f; 9 10 int n, 阅读全文
摘要:
https://codeforces.com/gym/103409 A(简单签到) 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 5 #define int long long 6 #define pb push_back 7 #defin 阅读全文
摘要:
环境包:cuda版本的torch、torchvision 系统环境:win10 X64,anaconda cuda和pytorch对应版本 https://pytorch.org/get-started/previous-versions/ 配置流程 1、添加源路径 #打开Anaconda Prom 阅读全文
摘要:
题意:给定一个n个点,m条边的有向图,边权为1。求把某一条边(依次从1-》m)去掉之后1到n的最短距离. 思路:这道题可以这么考虑。先求出1到N的最短路径,并记录路径。如果删掉的这条边不在最短路上,那么直接输出最短路。否则,我们暴力求出删掉边之后的最短路,判断一下即可。 时间复杂度(优先队列优化的D 阅读全文
摘要:
1 #include<bits/stdc++.h> 2 3 using namespace std; 4 5 #define int long long 6 7 const int N = 3e5+100 ; 8 9 signed main(){ 10 int T=1; 11 cin>>T; 12 阅读全文