- 博客(46)
- 资源 (2)
- 问答 (1)
- 收藏
- 关注
原创 UVA 10911
记忆化搜索+状态压缩DP, 1 表示之前没有选择过#include #include #include #include #include using namespace std;#define MAXN (120) + 100#define INF 1e10;double dp[MAXN];int n, S, cnt;struct Point{ i
2014-11-30 15:24:35 463
原创 UVA 10706
#include #include #include #include #include #include using namespace std;#define K sqrt(2147483647) + 1#define MAXN 1001000#define LL long longchar num[MAXN];LL sum[MAXN];int fan( int
2014-11-28 23:51:47 388
原创 UVA 757
#include #include #include #include #include using namespace std;#define MAXN 30int ans[MAXN], tmp[MAXN];int h, n;struct node{ int no, rate, cut, time; friend bool operator const
2014-11-28 23:51:13 452
原创 UVA 10057
#include #include #include #include #include using namespace std;#define MAXN 1000000 + 10int num[MAXN];int main(){ int n; int x1, x2; while(scanf("%d",&n) != EOF) { bo
2014-11-28 23:50:39 399
原创 UVA 270
#include#include#include#include#include#include#includeusing namespace std;struct node{ int x,y; node(){} node(int a,int b){x=a;y=b;}};int main(){ //freope
2014-11-28 23:49:49 323
原创 UVA 10132
#include #include #include #include #include #include using namespace std;#define N 500string str[N];map m;int main () { char s[N]; int n; cin >> n; getchar(); gets(s); while (n--)
2014-11-28 23:48:59 336
原创 UVA 10827
#include #include #include #include using namespace std;#define MAXN 200int num[MAXN][MAXN];int main(){ int t, n; scanf("%d",&t); while(t--) { scanf("%d",&n);
2014-11-28 23:48:27 414
原创 UVA 11054
#include #include #include #include using namespace std;#define LL long long#define MAXN 100100int main(){ int n; while(scanf("%d",&n) != EOF && n) { LL last = 0; LL
2014-11-28 23:48:00 246
原创 UVA 10763
#include #include #include #include #include using namespace std;map, int > list;int main(){ int n, a, b; while(scanf("%d",&n) != EOF && n) { list.clear(); int cnt
2014-11-28 23:46:58 297
原创 UVA 10382
#include #include #include #include #include #include using namespace std;#define MAXN 10010#define eps 1e-8struct node{ double l,r;}spr[MAXN];int cmp( node a, node b){ return a
2014-11-28 23:46:29 325
原创 UVA 10954
#include #include #include #include #include #include using namespace std;priority_queueint, vectorint>, greaterint> >que;int main(){ int n, val; while(scanf("%d",&n) != EOF && n
2014-11-28 23:44:37 337
原创 UVA 10026
#include #include #include #include #include using namespace std;#define MAXN 1010struct node{ double fan; int id;}task[MAXN];int cmp( node a, node b){ if(a.fan != b.fan)
2014-11-28 23:44:03 448
原创 UVA 10716
#include #include #include #include using namespace std;char str[111];int num[30];int solve( int len){ int ans = 0; for( int i = 0 ; i len/2; i++) { int j = len - 1 -
2014-11-28 23:43:30 404
原创 UVA 108
#include #include #include #include using namespace std;#define MAXN 1111int mar[MAXN][MAXN];int main(){ int n, val; while(scanf("%d", &n) != EOF && n) { memset(mar, 0,
2014-11-28 23:42:05 361
原创 UVA 10020
#include #include #include #include #include using namespace std;#define maxn 100000 + 10struct Node{ int l, r; int len;} node[maxn];int ans[maxn];int cmp ( Node a, Node b){
2014-11-28 23:41:41 379
原创 UVA 10487
UVA 10487#include #include #include #include #include using namespace std;bool cmp(string a,string b){ return (a+b)>(b+a);}int main(){ //freopen("in","r",stdin); in
2014-11-28 23:41:07 300
原创 UVA 10487
#include #include #include #include #include using namespace std;#define maxn 10010int num[maxn], que, n, ans, m;int solve( int sum){ int L = 0, R = n -1 ; int res = 0x1f1f1f1f;
2014-11-28 23:39:47 399
原创 UVA 311
#include#include#include#includeusing namespace std;int main(){ int a,b,c,d,e,f; int sum,flag; int t,t1; while(1) { sum=0; scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e
2014-11-28 23:39:30 301
原创 UVA 10718
#include #include #include #include using namespace std;#define LL unsignedint main(){ LL n,l,r,m; while(scanf("%u %u %u", &n, &l, &r) !=EOF) { int m = 0; for( int
2014-11-28 23:38:47 429
原创 UVA 10714
#include #include #include #include #include using namespace std;#define MAXN 1000000 + 10int pos[MAXN];int main(){ int t; scanf("%d",&t); while(t--) { int len, n;
2014-11-28 23:37:57 365
原创 uva 10602
#include #include #include #include #include using namespace std;#define maxn 105bool vis[maxn];int order[maxn];int main(){ char fir[maxn]; int n, t, tem; char str[maxn][maxn]
2014-11-28 23:37:21 308
原创 uva 10487
#include #include #include #include using namespace std;const int N = 1005;const int INF = 0x3f3f3f3f;int set[N];int query[N];int n,m;int solve(int num) { //二分查找最近的和 int left = 0,right = n-
2014-11-19 23:34:58 320
原创 uva 311
#include#include#include#includeusing namespace std;int main(){ int a,b,c,d,e,f; int sum,flag; int t,t1; while(1) { sum=0; scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e
2014-11-19 23:25:11 306
原创 UVA 10602
#include #include #include #include #include using namespace std;#define maxn 105bool vis[maxn];int order[maxn];int main(){ char fir[maxn]; int n, t; char str[maxn][maxn];
2014-11-19 23:02:27 282
原创 Hdu 3555
#include #include #include #include using namespace std;#define maxn 22#define LL __int64int digit[maxn];LL dp[maxn][3];void init(){ dp[0][0] = 1; for( int
2014-11-17 00:31:23 314
原创 POJ 1742
#include #include #include #include using namespace std;#define N 100000 + 100int num[N], w[N], f[N], cnt[N];int n, m;int main(){ while(scanf("%d %d",&n , &m) != EOF &&(n + m)) {
2014-11-16 23:14:32 502
原创 UVALive 3782 Bigger is Better
#include #include #include #include using namespace std;#define maxn 110#define maxm 3010int dp[maxn][maxm];int cnum[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6 };int next[maxn][maxm], max_len;voi
2014-11-16 23:12:37 483
原创 POJ 1182
#include #include #include #include #include using namespace std;#define maxn 50100int fa[maxn], def[maxn];int find( int x ){ if(fa[x] == x) return x; int tem = find(fa[x]
2014-11-16 23:11:24 323
原创 POJ 1733
#include #include #include #include using namespace std;#define maxn 1000007#define LL long longstruct node{ LL data; int next;} hashta[1000100];int head[maxn], num;int def[1000100
2014-11-16 23:10:25 298
原创 POJ Find them ,catch them
#include #include #include #include using namespace std;#define maxn 100010int fa[maxn], turn[maxn];int find( int x){ if(fa[x] == x) return x; int tem = find(fa
2014-11-14 02:13:47 359
原创 zoj 3204
要求字典序最小 #include #include #include #include #include using namespace std;#define maxn 110#define INF 0x1f1f1f1fstruct node{ int cost; int u, v;} Edge[maxn
2014-11-12 01:04:16 311
原创 POJ 3101
哪里跟扩展欧几里得搭上边了么啊用C的话得用大数,java好一点分数求最小公倍数import java.math.*;import java.util.*;public class Main{ public static void main(String args[]) { BigInteger a, b, c, up = null, down = nu
2014-11-11 00:43:31 395
原创 hrubst 1328
#include #include #include #include using namespace std;int gcd( int a, int b){ if( b == 0) return a; return gcd(b, a%b);}int main(){ int n; int t; s
2014-11-10 15:07:23 342
转载 后缀数组
int wa[maxn],wb[maxn],wv[maxn],ws[maxn];int cmp(int *r,int a,int b,int l){return r[a]==r[b]&&r[a+l]==r[b+l];} //就像论文所说,由于末尾填了0,所以如果r[a]==r[b](实际是y[a]==y[b]),说明待合并的两个长为j的字符串,前面那个一定不包含末尾0,因而后面这个的起始
2014-11-09 00:25:01 228
原创 uva Happy Number
#include #include #include #include using namespace std;#define mod 10007struct node{ int num; int next;};node hashnode[mod];int head[100000], cnt;void
2014-11-07 20:40:22 262
原创 UVA 10125
#include #include #include #include #include #include #include using namespace std;int ans;struct node{ int data1, data2; int next;};node hash1[1000005];int index1[100007];int a[1005],
2014-11-03 21:53:47 353
原创 UVA 188
这个版本RE了好多次 #include #include #include #include #include #include #include using namespace std;int w[15];string tempstr, str;int cnt;void init(){ memset(w, 0, sizeof(w)); tem
2014-11-03 18:45:41 324
iOS app 模拟器图片显示不全
2016-01-06
TA创建的收藏夹 TA关注的收藏夹
TA关注的人