现在位置: 首页 > calla发表的所有文章
  • 05月
  • 15日
综合 ⁄ 共 2243字 评论关闭
block的序列化, tx的序列化 13:39:38  getrawtransaction 29b4ff508409c050cec2f7a6ebbb362e5b667ad3377eeede472a4d1815361254 13:39:57  01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0a530101062f503253482fffffffff0100e40b54020000002321037a059b62ec150ae13a61ba3fc4797f4223bfe18d2f1f60a928fc470134aa4298ac00000000 13:40:13  decoderawtransaction 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0a530101062f503253482ffffffff......
阅读全文
  • 04月
  • 11日
综合 ⁄ 共 1416字 评论关闭
以后遇到这种数据接近 limit 的必须小心  乘法! 要不就全用long long   __int64 推倒~ g(i)=k*i+b;代入Si  得 sn=f(b)+f(k+b)+f(2*k+b)+...+f((n-1)k+b) 建立斐波那契的递推的矩阵 A sn=A^b * (I+A^K+...+A^((n-1)*K))  * (f[0]#f[1]) (I为单位矩阵) 设 R 为A^K 构造矩阵 代入  ..AC #include <stdio.h> #include <string.h> #define ff(i,n) for(int i=0;i<n;i++) int M; struct Mat { int m[2][2]; friend Mat operator*(Mat a,Mat b) { Mat c; memset(c.m,0,sizeof(c.m));......
阅读全文
  • 03月
  • 20日
综合 ⁄ 共 1046字 评论关闭
1.检查某数是否为回文数:如12321,121,134431等等,如果是,返回1,否,返回-1 #include <stdio.h> #include <stdlib.h> void tranverse(unsigned long int a); int NumberLength(unsigned long int a); int power(int a); //检查某数是否为回文数:如12321,121,134431等等,如果是,返回1,否,返回-1 //思路:检查最高位和最低位是否相等,如等,去掉这两个数,如12321-->232-->3-->Yes; int flag; int main(void) { int a; scanf("%d",&a); tranverse(a); printf("%d/n",flag); return 0; } ......
阅读全文
  • 12月
  • 21日
综合 ⁄ 共 944字 评论关闭
http://poj.org/problem?id=1458  模版题   code1: #include <stdio.h> #include <string.h> #define MAXN 301 int LCS[MAXN][MAXN]; char str1[MAXN], str2[MAXN]; int main() { int len1, len2, i, j; while(scanf("%s%s",str1,str2)!=EOF) { memset(LCS,0,sizeof(LCS)); len1 = strlen(str1); len2 = strlen(str2); for(i=1; i<=len1; ++i) for(j=1; j<=len2; ++j) { if(str1[i-1]==str2[j-1]) LCS[i][j] = LCS[......
阅读全文
1001         KK的GFriend 本题水题。遍历输入数据给出的字符串。如果出现的I LOVE U各个字符都至少都有m个的话,则满足要求,否则不满足。 之前比赛时,输出描述的字符串和Sample Output不符(Sample Output为正确答案),导致部分同学wrong answer,请见谅。 [cpp] view plaincopyprint? #include<iostream>    #include<cstring>    #include<string>    #include<cstdio>    using namespace std;   const int maxn=10001;   char inp[maxn];   int num[6];   int main()   {       int cas,n,m......
阅读全文
  • 02月
  • 20日
综合 ⁄ 共 2595字 评论关闭
4. /*2014. 01 .11 by Arby*/ /*c++ primer 7.12 编程练习*/ /*错误输入时的情形,要进行探讨*/ #include <iostream> using namespace std; long double probability(int arr[], unsigned special, int choice); int main() { /*初始化*/ const int choice = 5; int field_number[choice]; int special = 0; int i =0; long double result = 0; /*操作*/ cout << "enter the number of five between 1 to 47: "; for(i = 0; i< choice; i++) { while(!(cin>> field_number[i]) || (field_num......
阅读全文
  • 11月
  • 13日
综合 ⁄ 共 25629字 评论关闭
翻译说明:这是一个日本人写的用户态下的函数tracer, 我们知道系统调用可以用strace, 库调用可以使用ltrace, 但是linux下竟然没有一个比较有名的用户程序的tracer, 这真是比较奇怪。 这个工具好的地方就是用ptrace系统调用来实现,只要跟踪的程序没有被strip,就可以使用,而不要重新编译程序。而另一种函数跟踪的方式(使用gcc -finstruction-functions),目标程序必须要重新编译,这个就大大降低了tracer的实用性。 但是目前这个工具只支持x86架构,arm之类的嵌入式环境不支持。 目前还剩下实现机制这一部分没有翻译完。 原文来......
阅读全文
  • 11月
  • 08日
综合 ⁄ 共 6747字 评论关闭
最近需要进行网络传输大文件,于是对基于socket的文件传输作了一个初步的了解。在一位网友提供的程序基础上,俺进行了一些加工,采用了缓冲输入/输出流来包装输出流,再采用数据输入/输出输出流进行包装,加快传输的速度。废话少说,先来看服务器端的程序。 1.服务器端 package sterning;import java.io.BufferedInputStream;import java.io.DataInputStream;import java.io.DataOutputStream;import java.io.File;import java.io.FileInputStream;import java.net.ServerSocket;import java.net.Socket;public class ServerTest ......
阅读全文
  • 04月
  • 12日
综合 ⁄ 共 4573字 评论关闭
依照官方教程添加文件及其 frameWork后 发现运行报错 错误如下 Undefined symbols for architecture i386:   "_OBJC_CLASS_$_ASIdentifierManager", referenced from:       objc-class-ref in libGoogleAdMobAds.a(GADIdentifierUtilities.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)   Undefined symbols for architecture i386: "_OBJC_CLASS_$_SKStoreProductViewController", referenced from:   objc-class-ref in RevMobAds(RevMo......
阅读全文
  • 03月
  • 26日
综合 ⁄ 共 10749字 评论关闭
实现效果: 低保真界面原型 代码讲解(创建部分) 1创建界面:初始化各种组件,搭建界面 #pragma mark- 初始化 :原点+高 - (instancetype)initWithOrigin:(CGPoint)origin andHeight:(CGFloat)height andDataArray:(NSMutableArray *)data; { // 位置信息 _origin = origin; _show=NO; _height = height; // 填充数据 dataArray=data; numOfMenu=[dataArray count]; currentSelectedMenudIndex=-1; // 绘制栏目头的轮廓 self=[self initWithFrame:CGRectMake(origi......
阅读全文
  • 12月
  • 17日
综合 ⁄ 共 2108字 评论关闭
Find Metal Mineral Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65768/65768 K (Java/Others) Total Submission(s): 2582    Accepted Submission(s): 1168 Problem Description Humans have discovered a kind of new metal mineral on Mars which are distributed in point‐like with paths connecting each of them which formed a tree. Now Humans launches k robots on Mars to collect them, and due to the unknown reasons, the landing site S of all robots is identified in advanced, in other wo......
阅读全文
  • 06月
  • 17日
综合 ⁄ 共 2440字 评论关闭
Bad Cowtractors Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10933 Accepted: 4614 Description Bessie has been hired to build a cheap internet network among Farmer John's N (2 <= N <= 1,000) barns that are conveniently numbered 1..N. FJ has already done some surveying, and found M (1 <= M <= 20,000) possible connection routes between pairs of barns. Each possible connection route has an associated cost C (1 <= C <= 100,000). Farmer John wants to spend the......
阅读全文