首页 > TAG信息列表 > submissions

31.下一个排序

class Solution { public: void nextPermutation(vector<int>& nums) { int i, j; if(nums.size() <= 1) return; for(i = nums.size()-2; i >= 0; i--){ //找左标记 if(nums[i] < nums[i + 1]){

LeetCode题解(八)0700-0799,Android攻防实战电子书

709. To Lower Case [Description] Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. [Example] Example 1: Input: “Hello” Output: “hello” Example 2: Input: “here” Output: “here” Example 3: In

第四周记录

1.有效的括号 https://leetcode-cn.com/problems/valid-parentheses/submissions/ 2.括号生成 https://leetcode-cn.com/problems/generate-parentheses/submissions/ 3.自定义字符串排序 https://leetcode-cn.com/problems/custom-sort-string/submissions/

AtCoder Beginner Contest 192 完整题意+题解

目录题解ABCDEF评价 题解 A 给你一个数 \(X\)(\(1\le X\le 10^5\)),求最小的 \(Y>X\) 使得 \(Y\) 是 \(100\) 的倍数。 直接判定即可。 B 给一个字符串,判断是否满足奇数位上是小写字母,偶数位上是大写字母。 也可以直接判定。 C 称一次操作为将一个数赋值为这个数的各个数字按照从大到

leetcode 922. Sort Array By Parity II(python)

描述 Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even. Sort the array so that whenever A[i] is odd, i is odd; and whenever A[i] is even, i is even. You may return any answer array that satisf

【AtCoder Beginner Contest Round #181】题解

题目颜色大致代表洛谷题目难度,点击各题标题可以跳转到原题。 A - Heavy Rotation 简化题意:给出正整数 $n$,如果 $n$ 是奇数输出 Black,否则输出 White,$n \le 30$。 题解:这题还要题解? 代码:https://atcoder.jp/contests/abc181/submissions/17780998 B - Trapezoid Sum 简化题意: 有

【LeetCode】【Math】Sum of square numbers

【题目】 给定非负整数c,本题的任务是判断是否存在整数a和b,使得a2+b2=c。 Example 1: Input: 5 Output: True Explanation: 1 * 1 + 2 * 2 = 5   Example 2:   Input: 3 Output: False【解法】暴力破解列出所有a和b的和,并与c比较。a和b的值在(0,sqrt(c))之间。参考解法(Java版本)也是

[leetcode]69

这道题,我先测试了下c++标准数学库,嗯,did it work!!! 而且效率还可以,不像pow的那道题,死慢 class Solution { public: int mySqrt(int x) { return sqrt(x); } }; Runtime: 4 ms, faster than 75.96% of C++ online submissions for Sqrt(x). Memory Usage:

AGC007

AGC007 A Shik and Stone 我是沙比这都能蛙一发 https://agc007.contest.atcoder.jp/submissions/7946110 B Construct Sequences 造两个等差数列\(20000,40000,\ldots,20000n\)和反过来作为基础\(A,B\),然后在上面减一下就好了。 https://agc007.contest.atcoder.jp/submissions/