1 2 3 4 5 ··· 10 下一页
摘要: 这期的题目整体比较简单,相比之前的都简单 第一题-塔子哥送粉丝周边 简单排序 #include<bits/stdc++.h> using namespace std; #define int long long const int N = 2e5+100; struct str{ int num; 阅读全文
posted @ 2024-04-29 15:07 pengge666 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 第一题-塔子哥的质数和合数 #include<bits/stdc++.h> using namespace std; #define int long long const int N = 2e5+100; int n,arr[N]; signed main(){ cin>>n; set<int> 阅读全文
posted @ 2024-04-28 16:00 pengge666 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 前言 写在前面,由于很长一段时间没有敲代码了,上周写了华为的题目,debug半天也没有debug出一道来,属实狠狠的打击到我了,因此特开此专栏,以便开启老年选手康复之路!!! 第一题-塔子哥的好子矩阵 前3题,手速题 水题 #include<bits/stdc++.h> using namespac 阅读全文
posted @ 2024-04-27 21:12 pengge666 阅读(1) 评论(0) 推荐(0) 编辑
摘要: SQL-Boy上线,最近在写SQL语句遇到了这样的问题。 Problem:Every derived table must have its own alias 错误语句如下 delete from Person where id not in ( select id from ( select m 阅读全文
posted @ 2024-04-19 11:32 pengge666 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 题意不是很清晰: 1.比如对于 graph=[[1,1,0],[1,1,1],[0,1,1]], initial=[0,1] 来说,可以发现结点的链接情况是 0-1-2,感染源结点是0和1,若是按之前题目的要求,移除0和1都不会减少最终感染个数,但是应该返回结点0,因为其 index 小。但是应用此 阅读全文
posted @ 2024-04-17 10:51 pengge666 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 这道题目是经典的求 子数组之和=goal的个数,用map维护。 但是笔者在实现的过程中发现0的情况不是很好出来,问题在于mp[sum]和sum+=num的代码语句存在位置问题。后来看了下代码还是自己没有考虑清楚。 这种类型的题目就是要想清楚你的做法,以及边界条件。 class Solution { 阅读全文
posted @ 2024-03-28 10:41 pengge666 阅读(3) 评论(0) 推荐(0) 编辑
摘要: #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){ 阅读全文
posted @ 2024-03-21 14:23 pengge666 阅读(48) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2022-08-23 21:10 pengge666 阅读(35) 评论(0) 推荐(0) 编辑
摘要: A题 题意: 让你去买苹果,你有2种购买方式 买1个苹果花费x元 买3个苹果花费y元。 问最少用多少钱可以买到 n个苹果 1 import java.util.Scanner; 2 3 public class Main { 4 public static void main(String[] ar 阅读全文
posted @ 2022-08-23 12:05 pengge666 阅读(50) 评论(0) 推荐(0) 编辑
摘要: 暴力解决 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 阅读全文
posted @ 2022-06-19 23:25 pengge666 阅读(14) 评论(0) 推荐(0) 编辑
1 2 3 4 5 ··· 10 下一页