09 2020 档案
摘要:Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 } is 1
阅读全文
摘要:787. 归并排序 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int main() 5 { 6 int n, a[100001]; cin >> n; 7 for(int i = 0; i < n; i++) cin >> a[i];
阅读全文
摘要:1. A + B 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 typedef unsigned long long L; 5 6 int main() 7 { 8 L n, m; cin >> n >> m; 9 cout << n+m;
阅读全文
摘要:Look-and-say sequence is a sequence of integers as the following: D, D1, D111, D113, D11231, D112213111, ... where D is in [0, 9] except 1. The (n+1)s
阅读全文
摘要:A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number
阅读全文
摘要:Consider a positive integer N written in standard notation with k+1 digits ai as ak⋯a1a0 with 0 for all i and ak>0. Then N is palindrom
阅读全文
摘要:Given a tree, you are supposed to tell if it is a complete binary tree. Input Specification: Each input file contains one test case. For each case, th
阅读全文
摘要:Sexy primes are pairs of primes of the form (p, p+6), so-named since "sex" is the Latin word for "six". (Quoted from http://mathworld.wolfram.com/Sexy
阅读全文