摘要:
SQL-Boy上线,最近在写SQL语句遇到了这样的问题。 Problem:Every derived table must have its own alias 错误语句如下 delete from Person where id not in ( select id from ( select m 阅读全文
摘要:
题意不是很清晰: 1.比如对于 graph=[[1,1,0],[1,1,1],[0,1,1]], initial=[0,1] 来说,可以发现结点的链接情况是 0-1-2,感染源结点是0和1,若是按之前题目的要求,移除0和1都不会减少最终感染个数,但是应该返回结点0,因为其 index 小。但是应用此 阅读全文
摘要:
这道题目是经典的求 子数组之和=goal的个数,用map维护。 但是笔者在实现的过程中发现0的情况不是很好出来,问题在于mp[sum]和sum+=num的代码语句存在位置问题。后来看了下代码还是自己没有考虑清楚。 这种类型的题目就是要想清楚你的做法,以及边界条件。 class Solution { 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; #define int long long const int N=666; int arr[N][N]; int sum[N][N]; signed main(){ int n; while(cin>>n){ 阅读全文
摘要:
A题 桶排序 1 import java.util.*; 2 public class Main { 3 public static void main(String[] args) { 4 Scanner sc=new Scanner(System.in); 5 int[] arr=new int 阅读全文
摘要:
A题 题意: 让你去买苹果,你有2种购买方式 买1个苹果花费x元 买3个苹果花费y元。 问最少用多少钱可以买到 n个苹果 1 import java.util.Scanner; 2 3 public class Main { 4 public static void main(String[] ar 阅读全文
摘要:
暴力解决 1 class Solution: 2 def greatestLetter(self, s: str) -> str: 3 a=[0]*66 4 b=[0]*66 5 # str=input() 6 7 for ch in s: 8 if ch.isupper(): 9 a[ord(ch 阅读全文
摘要:
按照题意模拟就行 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 阅读全文