- 博客(12)
- 收藏
- 关注
原创 java常用函数
1.用于进制转换 // s:输入的数字 x:原数的进制 y:要转化成的进制 public static String Transform(String s,int x,int y) { return new java.math.BigInteger(s,x).toString(y); } 2.字符串与数字的转换 int a=Integer.value...
2019-09-11 19:00:14 221
原创 大数
http://acm.hdu.edu.cn/showproblem.php?pid=1261 import java.util.Scanner; import java.math.BigInteger; class Main { public static void main(String[] args) { Scanner cin=new Scanner(System.in); ...
2019-09-08 21:08:30 162
原创 字符串和数字的转换
1 利用stringstream 添加头文件 #include<sstream> 数字转字符串 #include <string> #include <sstream> int main(){ double a = 123.32; string res; stringstream ss; ...
2019-08-18 11:09:35 617
原创 自然数的拆分问题
题目描述 输入自然数n,然后将其拆分成由若干数相加的形式,参与加法运算的数可以重复。 输入 一个整数n,指待拆分的自然数n(l≤n≤30)。 输出 若干行,每一行是一个数的加法式子。 样例输入 复制样例数据 4 样例输出 1+3 1+1+2 1+1+1+1 2+2 按字典序 (回溯) #include<bits/stdc++....
2019-08-17 11:35:19 3046
原创 poj1256 Anagram (全排列)
Anagram Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 22698 Accepted: 8955 Description You are to write a program that has to generate all possible words from a g...
2019-08-15 13:07:01 242
原创 2-sat(hdu3062)
2-sat 参考:https://www.cnblogs.com/L-Excalibur/p/8504893.html 例题hdu3062 http://acm.hdu.edu.cn/showproblem.php?pid=3062 dfs暴力做法 #include<bits/stdc++.h> using namespace std; vector<int>f[2...
2019-08-12 11:50:25 162
原创 读入带空格的字符串
对于char类型带空格字符串: gets() gets() 不能被告知输入缓冲区的大小, 因此不能避免缓冲区的溢出。对应输出puts(); fgets() fgets(str,100,stdin); 输出fputs(str,stdout); [第二个参数是要读取的字符串长度] scanf("%[^\n]",str) 遇回车结束。 cin.get(str,100) ...
2019-08-10 09:10:46 2817
转载 极角逆时针排序
#include<iostream> #include<cstdio> #include<algorithm> #include<cstring> #include<cmath> using namespace std; struct node { int x,y; }; node p[55]; int cross(node a...
2019-08-08 15:18:54 313
原创 POJ2079&&HDU2202Triangle(凸包和旋转卡壳)
凸包参考资料:https://blog.csdn.net/qq_30974369/article/details/76405546 旋转卡壳参考资料:https://www.cnblogs.com/shangyu/p/3873876.html POJ2079 Triangle Time Limit: 3000MS Memory Limit: 30000K Total...
2019-08-08 14:16:30 187
原创 Intersecting Lines(两条线段的位置关系)
平行不共线 平行共线 相交并求交点 Intersecting Lines We all know that a pair of distinct points on a plane defines a line and that a pair of lines on a plane will intersect in one of three ways: 1) no intersectio...
2019-08-07 20:37:22 576
原创 Segments(直线和线段的投影)
Given n segments in the two dimensional space, write a program, which determines if there exists a line such that after projecting these segments on it, all projected segments have at least one point ...
2019-08-07 19:31:33 1468
原创 TOYS (向量叉积)
Calculate the number of toys that land in each bin of a partitioned toy box. Mom and dad have a problem - their child John never puts his toys away when he is finished playing with them. They gave Joh...
2019-08-07 16:29:03 357
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人