Given a perimeter of 60, we can find two right triangles with integral length sides: [(10, 24, 26), (15, 20, 25)]. Complete the following function, wh ...
分类:
其他好文 时间:
2020-05-28 00:59:06
阅读次数:
86
https://codeforces.ml/contest/1360/problem/H 题目应该挺好理解,先讲我自己想的,很直观: 最小值为0,假设最大值(就是二进制为m个1)为maxx,如果一个值都不去,那么答案就是mid = maxx/2,但是现在我们要去掉一些数,我们在去掉数的过程中,这个m ...
分类:
其他好文 时间:
2020-05-27 00:46:06
阅读次数:
69
package LeetCode_496 /** * 496. Next Greater Element I * https://leetcode.com/problems/next-greater-element-i/description/ * * You are given two array ...
分类:
其他好文 时间:
2020-05-26 22:09:23
阅读次数:
112
H. Binary Median 题意:给定$n$,\(m\),及$n$个二进制数,在由0到$2m-1$这$2m$个二进制数中删掉这$n$个数,求剩余二进制数的中位数。 LL trans(char s[]) { int len = strlen(s); int j=0; LL ans=0; whil ...
分类:
其他好文 时间:
2020-05-26 00:58:54
阅读次数:
103
题面 Time limit per test: 2 seconds Memory limit per test: 256 megabytes Description Consider all binary strings of length m ( 1≤m≤60 ). A binary string ...
分类:
其他好文 时间:
2020-05-25 12:26:07
阅读次数:
95
链接:https://leetcode-cn.com/problems/add-two-numbers/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * L ...
分类:
其他好文 时间:
2020-05-25 00:15:00
阅读次数:
65
Find the sum of all left leaves in a given binary tree. Example: 3 / \ 9 20 / \ 15 7 There are two left leaves in the binary tree, with values 9 and 1 ...
分类:
其他好文 时间:
2020-05-24 11:27:13
阅读次数:
52
Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval li ...
分类:
其他好文 时间:
2020-05-24 09:40:12
阅读次数:
58
博客转自:http://www.lighthouse3d.com/tutorials/glut-tutorial/subwindow-reshape/ The callback for the reshape function needs to do two things: it resizes t ...
分类:
其他好文 时间:
2020-05-23 18:30:51
阅读次数:
61
#include<bits/stdc++.h>#define ll long longusing namespace std;/*题意:A和B两人分n个糖,每人最少一个,且A分得的数量要大于B,只要分奇偶情况输出就行*/int main(){ ll t,n; cin>>t; for(int i=0; ...
分类:
其他好文 时间:
2020-05-23 13:09:20
阅读次数:
51