上一页 1 ··· 64 65 66 67 68
摘要: E - Cable master POJ - 1064 Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered a 阅读全文
posted @ 2020-04-07 22:53 XXXSANS 阅读(106) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> using namespace std; void dfs( int index , int a[] , int n ){ if( index == n ){ for( int i = 0 ; i < n ; i ++ ) cout << a[i]; 阅读全文
posted @ 2020-04-07 18:48 XXXSANS 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 题目: 给定两个二进制字符串,返回他们的和(用二进制表示)。 样例 a = 11 b = 1 返回 100 代码: #include<bits/stdc++.h> using namespace std; const int maxn=1e3+5; char a[maxn],s1[maxn],s2[ 阅读全文
posted @ 2020-04-07 18:47 XXXSANS 阅读(193) 评论(0) 推荐(0) 编辑
摘要: accumulate定义在#include<numeric>中,作用有两个,一个是累加求和,另一个是自定义类型数据的处理 1.累加求和int sum = accumulate(vec.begin() , vec.end() , 42); accumulate带有三个形参:头两个形参指定要累加的元素范 阅读全文
posted @ 2020-04-07 18:35 XXXSANS 阅读(2127) 评论(0) 推荐(0) 编辑
摘要: 题面 The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C 阅读全文
posted @ 2020-04-06 12:32 XXXSANS 阅读(195) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> using namespace std; /** std::pair主要的作用是将两个数据组合成一个数据,两个数据可以是同一类型或者不同类型。 例如std::pair<int,float> 或者 std::pair<double,double>等。 pair实 阅读全文
posted @ 2020-04-06 12:01 XXXSANS 阅读(450) 评论(0) 推荐(0) 编辑
摘要: 愚人节专场fucking high♂(tourist59minAK ?!?!!Orz A.Is it rated? 唯一一道我没wa tourist wa一发 的题。。。 #include <bits/stdc++.h>using namespace std;int main(){ cout << 阅读全文
posted @ 2020-04-02 09:54 XXXSANS 阅读(405) 评论(2) 推荐(0) 编辑
摘要: 【题面】 You are given a string s of length n consisting of lowercase English letters. This string can be used to build other strings. The cost of each le 阅读全文
posted @ 2020-03-31 16:57 XXXSANS 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 题目 https://www.hackerrank.com/challenges/yet-another-minimax-problem 题意 给出 n 个整数,求一个排列使得相邻两数的异或值的最大值最小,输出该值。 题解 如果有一位所有数都是 0 或 1,则异或之后这一位始终是 0。 如果有一位既 阅读全文
posted @ 2020-03-31 11:08 XXXSANS 阅读(231) 评论(0) 推荐(0) 编辑
上一页 1 ··· 64 65 66 67 68