ICode9

精准搜索请尝试: 精确搜索
  • [AcWing 785] 快速排序2022-09-15 22:30:21

    第一篇博客诶!!! 点击查看代码 #include<iostream> using namespace std; const int N = 100010; int n; int q[N]; void quick_sort(int q[], int l, int r){ if(l >= r) return; //只有一个数或者没有数时则不用去遍历了 //int x = q[l]; //会超时 有两组数据

  • D. Lost Arithmetic Progression ,Codeforces Round #785 (Div. 2)2022-05-03 11:35:44

         a1,d1,n1 分别为b首项,公差,总项数      a2,d2,n2 分别为c首项,公差,总项数 首先明确当一个等差数列是另一个等差数列的一部分时,那么前者公差一定是后者公差的倍数 先判断0的情况,当c不是b的一部分时为0,包括两种情况:                                  

  • Codeforces Round #785 (Div. 2)2022-05-02 23:02:45

    由于鄙人能力有限 只做了三道题 签到题 没啥好说的 点击查看代码 #include<bits/stdc++.h> using namespace std; #define lowbit(x) x&(-x) #define ll long long const int maxn=5e4+5; void solve(); int main(){ int T;cin>>T; while(T--)solve(); return 0; } void

  • Codeforces Round #785 (Div. 2) [D-E] 题解2022-05-01 18:35:03

    目录D. Lost Arithmetic Progression题目大意思路代码E. Power or XOR?题目大意思路代码 D. Lost Arithmetic Progression 题目大意 A, B是两个有限长度的等差数列,C是在A,B都出现的元素组成的另一个等差数列。 现在给定B,C的首项\(f_b,f_c\),公差\(d_b,d_c\)和长度\(l_b,l_c\)求解

  • Codeforces Round #785 (Div. 2) A - C 题解2022-05-01 01:01:19

    Codeforces Round #785 (Div. 2) 今天五一集训第一天,刚打完一场组队赛,晚上本来想摆了,但是刚好洗完澡就开始了,就顺手写一下 A. Subtle Substring Subtraction 题目大意:两人博弈,A只能删除偶数个字符的子串,B只能删除奇数个字符的子串,a-z 被删除的得分是 1-26,问最终的差值和获胜的人

  • AcWing 785. 快速排序(java)2022-03-20 10:59:52

    谢谢y老师模版和大佬们题解❤️ 年轻y总好帅爱了爱了❤️ 有输入输出版

  • acwing-785. 快速排序2022-01-16 12:02:59

    给定你一个长度为 n 的整数数列。 请你使用快速排序对这个数列按照从小到大进行排序。 并将排好序的数列按顺序输出。 输入格式 输入共两行,第一行包含整数 n。 第二行包含 n 个整数(所有整数均在 1∼10^9 范围内),表示整个数列。 输出格式 输出共一行,包含 n 个整数,表示排好序的数列。

  • 打卡LeetCode2021-11-23 18:31:24

    2021.11.22 784. 字母大小写全排列 785. 模糊坐标 2021.11.23 93. 复原IP地址

  • LeetCode 785 Is Graph Bipartite? (dfs 染色)2021-10-10 15:02:58

    There is an undirected graph with n nodes, where each node is numbered between 0 and n - 1. You are given a 2D array graph, where graph[u] is an array of nodes that node u is adjacent to. More formally, for each v in graph[u], there is an und

  • 785. 快速排序2021-10-07 12:32:33

    给定你一个长度为 n 的整数数列。 请你使用快速排序对这个数列按照从小到大进行排序。 并将排好序的数列按顺序输出。 输入格式 输入共两行,第一行包含整数 n。 第二行包含 n 个整数(所有整数均在 1∼109 范围内),表示整个数列。 输出格式 输出共一行,包含 n 个整数,表示排好序的数

  • leetcode-785. 判断二分图2021-09-18 15:03:21

          class Solution { public: bool isBipartite(vector<vector<int>>& graph) { int n = graph.size(); if(n==0) return true; queue<int> q; vector<int> color(n, 0); // 0表示未

  • 785. 快速排序2021-07-19 18:01:07

    给定你一个长度为 n 的整数数列。 请你使用快速排序对这个数列按照从小到大进行排序。 并将排好序的数列按顺序输出。 输入格式 输入共两行,第一行包含整数 n。 第二行包含 n 个整数(所有整数均在 1∼109 范围内),表示整个数列。 输出格式 输出共一行,包含 n 个整数,表示排好序的数

  • 785. 快速排序2021-06-26 11:03:42

    快排板子 从小到大排序 以j分界 #include <iostream> using namespace std; const int N = 100010; int n; int q[N]; void quick_sort(int l, int r){ if(l >= r) return; int i = l - 1, j = r + 1, x = q[l + r >> 1]; // 1 while(i < j){

  • 785. Is Graph Bipartite? [Medium]2021-05-16 14:32:39

    判断是否为二部图,本质是无向图的相邻节点涂色必须不同  /** * 图的dfs * colored数组中,1和-1代表两个颜色 * Runtime: 0 ms, faster than 100.00% * Memory Usage: 39 MB, less than 97.60% */ class Solution { public boolean isBipartite(int[][] graph) {

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有